home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-bgp-bgp4-06.txt < prev    next >
Text File  |  1993-07-08  |  130KB  |  3,192 lines

  1.  
  2.  
  3. Network Working Group                                      Y. Rekhter
  4. INTERNET DRAFT                 T.J. Watson Research Center, IBM Corp.
  5.                                                                  T.Li
  6.                                                         cisco Systems
  7.                                                               Editors
  8.                                                             June 1993
  9.  
  10.  
  11.                   A Border Gateway Protocol 4 (BGP-4)
  12.  
  13.  
  14. Status of this Memo
  15.  
  16.    This document, together with its companion document, "Application of
  17.    the Border Gateway Protocol in the Internet", define an inter-
  18.    autonomous system routing protocol for the Internet. This document
  19.    specifies an IAB standards track protocol for the Internet community,
  20.    and requests discussion and suggestions for improvements.  Please
  21.    refer to the current edition of the "IAB Official Protocol Standards"
  22.    for the standardization state and status of this protocol.
  23.    Distribution of this document is unlimited.
  24.  
  25.    This document is an Internet Draft. Internet Drafts are working
  26.    documents of the Internet Engineering Task Force (IETF), its Areas,
  27.    and its Working Groups. Note that other groups may also distribute
  28.    working documents as Internet Drafts.
  29.  
  30.    Internet Drafts are draft documents valid for a maximum of six
  31.    months. Internet Drafts may be updated, replaced, or obsoleted by
  32.    other documents at any time. It is not appropriate to use Internet
  33.    Drafts as reference material or to cite them other than as a "working
  34.    draft" or "work in progress".
  35.  
  36.  
  37. 1. Acknowledgements
  38.  
  39.    This document was originally published as RFC 1267 in October 1991,
  40.    jointly authored by Kirk Lougheed (cisco Systems) and Yakov Rekhter
  41.    (IBM).
  42.  
  43.    We would like to express our thanks to Guy Almes (Rice University),
  44.    Len Bosack (cisco Systems), and Jeffrey C. Honig (Cornell University)
  45.    for their contributions to the earlier version of this document.
  46.  
  47.    We like to explicitly thank Bob Braden (ISI) for the review of the
  48.    earlier version of this document as well as his constructive and
  49.    valuable comments.
  50.  
  51.  
  52.  
  53.  
  54. Expiration Date January 1994                                    [Page 1]
  55.  
  56. INTERNET DRAFT                                                April 1993
  57.  
  58.  
  59.    We would also like to thank Bob Hinden, Director for Routing of the
  60.    Internet Engineering Steering Group, and the team of reviewers he
  61.    assembled to review earlier versions of this document.  This team,
  62.    consisting of Deborah Estrin, Milo Medin, John Moy, Radia Perlman,
  63.    Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted with a
  64.    strong combination of toughness, professionalism, and courtesy.
  65.  
  66.    This updated version of the document is the product of the IETF BGP
  67.    Working Group with Yakov Rekhter and Tony Li as editors. Certain
  68.    sections of the document borrowed heavily from IDRP [7], which is the
  69.    OSI counterpart of BGP. For this credit should be given to the ANSI
  70.    X3S3.3 group chaired by Lyman Chapin (BBN) and to Charles Kunzinger
  71.    (IBM Corp.) who is the IDRP editor within that group.  We would also
  72.    like to thank Mike Craren (Proteon, Inc.), Dimitry Haskin (BBN) and
  73.    Dennis Ferguson (University of Toronto) for their insightful
  74.    comments.
  75.  
  76.  
  77. 2.  Introduction
  78.  
  79.    The Border Gateway Protocol (BGP) is an inter-Autonomous System
  80.    routing protocol.  It is built on experience gained with EGP as
  81.    defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as
  82.    described in RFC 1092 [2] and RFC 1093 [3].
  83.  
  84.    The primary function of a BGP speaking system is to exchange network
  85.    reachability information with other BGP systems.  This network
  86.    reachability information includes information on the list of
  87.    Autonomous Systems (ASs) that reachability information traverses.
  88.    This information is sufficient to construct a graph of AS
  89.    connectivity from which routing loops may be pruned and some policy
  90.    decisions at the AS level may be enforced.
  91.  
  92.    BGP-4 provides a new set of mechanisms for supporting classless
  93.    interdomain routing.  These mechanisms include support for
  94.    advertising an IP prefix and eliminates the concept of network
  95.    "class" within BGP.  BGP-4 also introduces mechanisms which allow
  96.    aggregation of routes, including aggregation of AS paths.  These
  97.    changes provide support for the proposed supernetting scheme [8].
  98.  
  99.    To characterize the set of policy decisions that can be enforced
  100.    using BGP, one must focus on the rule that a BGP speaker  advertise
  101.    to its peer in neighbor ASs only those routes that it itself uses.
  102.    This rule reflects the "hop-by-hop" routing paradigm generally used
  103.    throughout the current Internet.  Note that some policies cannot be
  104.    supported by the "hop-by-hop" routing paradigm and thus require
  105.    techniques such as source routing to enforce.  For example, BGP does
  106.    not enable one AS to send traffic to a neighboring AS intending that
  107.  
  108.  
  109.  
  110. Expiration Date January 1994                                    [Page 2]
  111.  
  112. INTERNET DRAFT                                                April 1993
  113.  
  114.  
  115.    the traffic take a different route from that taken by traffic
  116.    originating in the neighboring AS.  On the other hand, BGP can
  117.    support any policy conforming to the "hop-by-hop" routing paradigm.
  118.    Since the current Internet uses only the "hop-by-hop" routing
  119.    paradigm and since BGP can support any policy that conforms to that
  120.    paradigm, BGP is highly applicable as an inter-AS routing protocol
  121.    for the current Internet.
  122.  
  123.    A more complete discussion of what policies can and cannot be
  124.    enforced with BGP is outside the scope of this document (but refer to
  125.    the companion document discussing BGP usage [5]).
  126.  
  127.    BGP runs over a reliable transport protocol.  This eliminates the
  128.    need to implement explicit update fragmentation, retransmission,
  129.    acknowledgement, and sequencing.  Any authentication scheme used by
  130.    the transport protocol may be used in addition to BGP's own
  131.    authentication mechanisms.  The error notification mechanism used in
  132.    BGP assumes that the transport protocol supports a "graceful" close,
  133.    i.e., that all outstanding data will be delivered before the
  134.    connection is closed.
  135.  
  136.    BGP uses TCP [4] as its transport protocol.  TCP meets BGP's
  137.    transport requirements and is present in virtually all commercial
  138.    routers and hosts.  In the following descriptions the phrase
  139.    "transport protocol connection" can be understood to refer to a TCP
  140.    connection.  BGP uses TCP port 179 for establishing its connections.
  141.  
  142.    This memo uses the term `Autonomous System' (AS) throughout.  The
  143.    classic definition of an Autonomous System is a set of routers under
  144.    a single technical administration, using an interior gateway protocol
  145.    and common metrics to route packets within the AS, and using an
  146.    exterior gateway protocol to route packets to other ASs.  Since this
  147.    classic definition was developed, it has become common for a single
  148.    AS to use several interior gateway protocols and sometimes several
  149.    sets of metrics within an AS.  The use of the term Autonomous System
  150.    here stresses the fact that, even when multiple IGPs and metrics are
  151.    used, the administration of an AS appears to other ASs to have a
  152.    single coherent interior routing plan and presents a consistent
  153.    picture of what networks are reachable through it.
  154.  
  155.    The planned use of BGP in the Internet environment, including such
  156.    issues as topology, the interaction between BGP and IGPs, and the
  157.    enforcement of routing policy rules is presented in a companion
  158.    document [5].  This document is the first of a series of documents
  159.    planned to explore various aspects of BGP application.  Please send
  160.    comments to the BGP mailing list (iwg@ans.net).
  161.  
  162.  
  163.  
  164.  
  165.  
  166. Expiration Date January 1994                                    [Page 3]
  167.  
  168. INTERNET DRAFT                                                April 1993
  169.  
  170.  
  171. 3.  Summary of Operation
  172.  
  173.    Two systems form a transport protocol connection between one another.
  174.    They exchange messages to open and confirm the connection parameters.
  175.    The initial data flow is the entire BGP routing table.  Incremental
  176.    updates are sent as the routing tables change.  BGP does not require
  177.    periodic refresh of the entire BGP routing table.  Therefore, a BGP
  178.    speaker must retain the current version of the entire BGP routing
  179.    tables of all of its peers for the duration of the connection.
  180.    KeepAlive messages are sent periodically to ensure the liveness of
  181.    the connection.  Notification messages are sent in response to errors
  182.    or special conditions.  If a connection encounters an error
  183.    condition, a notification message is sent and the connection is
  184.    closed.
  185.  
  186.    The hosts executing the Border Gateway Protocol need not be routers.
  187.    A non-routing host could exchange routing information with routers
  188.    via EGP or even an interior routing protocol.  That non-routing host
  189.    could then use BGP to exchange routing information with a border
  190.    router in another Autonomous System.  The implications and
  191.    applications of this architecture are for further study.
  192.  
  193.    If a particular AS has multiple BGP speakers and is providing transit
  194.    service for other ASs, then care must be taken to ensure a consistent
  195.    view of routing within the AS.  A consistent view of the interior
  196.    routes of the AS is provided by the interior routing protocol.  A
  197.    consistent view of the routes exterior to the AS can be provided by
  198.    having all BGP speakers within the AS maintain direct BGP connections
  199.    with each other.  Using a common set of policies, the BGP speakers
  200.    arrive at an agreement as to which border routers will serve as
  201.    exit/entry points for particular networks outside the AS.  This
  202.    information is communicated to the AS's internal routers, possibly
  203.    via the interior routing protocol.  Care must be taken to ensure that
  204.    the interior routers have all been updated with transit information
  205.    before the BGP speakers announce to other ASs that transit service is
  206.    being provided.
  207.  
  208.    Connections between BGP speakers of different ASs are referred to as
  209.    "external" links.  BGP connections between BGP speakers within the
  210.    same AS are referred to as "internal" links.
  211.  
  212. 3.1 Routes: Advertisement and Storage
  213.  
  214.    For purposes of this protocol a route is defined as a unit of
  215.    information that pairs a destination with the attributes of a path to
  216.    that destination:
  217.  
  218.       - Routes are advertised between a pair of BGP speakers in UPDATE
  219.  
  220.  
  221.  
  222. Expiration Date January 1994                                    [Page 4]
  223.  
  224. INTERNET DRAFT                                                April 1993
  225.  
  226.  
  227.       messages: the destination is the systems whose IP addresses are
  228.       reported in the Network Layer Reachability Information (NLRI)
  229.       field, and the the path is the information reported in the path
  230.       attributes fields of the same UPDATE message.
  231.  
  232.  
  233.       - Routes are stored in the Routing Information Bases (RIBs):
  234.       namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes
  235.       that will be advertised to other BGP speakers must be present in
  236.       the Adj-RIB-Out; routes that will be used by the local BGP speaker
  237.       must be present in the Loc-RIB, and the next hop for each of these
  238.       routes must be present in the local BGP speaker's forwarding
  239.       information base; and routes that are received from other BGP
  240.       speakers are present in the Adj-RIBs-In.
  241.  
  242.  
  243.    If a BGP speaker chooses to advertise the route, it may add to or
  244.    modify the path attributes of the route before advertising it to
  245.    adjacent BGP speaker.
  246.  
  247.    BGP provides mechanisms by which a BGP speaker can inform its
  248.    neighbor that a previously advertised route is no longer available
  249.    for use.  There are three methods by which a given BGP speaker can
  250.    indicate that a route has been withdrawn from service:
  251.  
  252.  
  253.       a) the IP prefix that expresses destinations for a previously
  254.       advertised route can be advertised in the WITHDRAWN ROUTES field
  255.       in the UPDATE message, thus marking the associated route as being
  256.       no longer available for use
  257.  
  258.       b) a replacement route with the same Network Layer Reachability
  259.       Information can be advertised, or
  260.  
  261.       c) the BGP speaker - BGP speaker connection can be closed, which
  262.       implicitly removes from service all routes which the pair of
  263.       speakers had advertised to each other.
  264.  
  265.  
  266. 3.2 Routing Information Bases
  267.  
  268.    The Routing Information Base (RIB) within a BGP speaker consists of
  269.    three distinct parts:
  270.  
  271.       a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has
  272.       been learned from inbound UPDATE messages. Their contents
  273.       represent routes that are available as an input to the Decision
  274.       Process.
  275.  
  276.  
  277.  
  278. Expiration Date January 1994                                    [Page 5]
  279.  
  280. INTERNET DRAFT                                                April 1993
  281.  
  282.  
  283.       b) Loc-RIB: The Loc-RIB contains the local routing information
  284.       that the BGP speaker has selected by applying its local policies
  285.       to the routing information contained in its Adj-RIBs-In.
  286.  
  287.       c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the
  288.       local BGP speaker has selected for advertisement to its neighbors.
  289.       The routing information stored in the Adj-RIBs-Out will be carried
  290.       in the local BGP speaker's UPDATE messages and advertised to its
  291.       neighbor BGP speakers.
  292.  
  293.  
  294.    In summary, the Adj-RIBs-In contain unprocessed routing information
  295.    that has been advertised to the local BGP speaker by its neighbors;
  296.    the Loc-RIB contains the routes that have been selected by the local
  297.    BGP speaker's Decision Process; and the Adj-RIBs-Out organize the
  298.    routes for advertisement to specific neighbor BGP speakers by means
  299.    of the local speaker's UPDATE messages.
  300.  
  301.    Although the conceptual model distinguishes between Adj-RIBs-In,
  302.    Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an
  303.    implementation must maintain three separate copies of the routing
  304.    information. The choice of implementation (for example, 3 copies of
  305.    the information vs 1 copy with pointers) is not constrained by the
  306.    protocol.
  307.  
  308. 4.  Message Formats
  309.  
  310.    This section describes message formats used by BGP.
  311.  
  312.    Messages are sent over a reliable transport protocol connection.  A
  313.    message is processed only after it is entirely received.  The maximum
  314.    message size is 4096 octets.  All implementations are required to
  315.    support this maximum message size.  The smallest message that may be
  316.    sent consists of a BGP header without a data portion, or 19 octets.
  317.  
  318.  
  319. 4.1 Message Header Format
  320.  
  321.  
  322.    Each message has a fixed-size header.  There may or may not be a data
  323.    portion following the header, depending on the message type.  The
  324.    layout of these fields is shown below:
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. Expiration Date January 1994                                    [Page 6]
  335.  
  336. INTERNET DRAFT                                                April 1993
  337.  
  338.  
  339.        0                   1                   2                   3
  340.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  341.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  342.       |                                                               |
  343.       +                                                               +
  344.       |                                                               |
  345.       +                                                               +
  346.       |                           Marker                              |
  347.       +                                                               +
  348.       |                                                               |
  349.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  350.       |          Length               |      Type     |
  351.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  352.  
  353.  
  354.       Marker:
  355.  
  356.          This 16-octet field contains a value that the receiver of the
  357.          message can predict.  If the Type of the message is OPEN, or if
  358.          the Authentication Code used in the OPEN message of the
  359.          connection is zero, then the Marker must be all ones.
  360.          Otherwise, the value of the marker can be predicted by some a
  361.          computation specified as part of the authentication mechanism
  362.          used.  The Marker can be used to detect loss of synchronization
  363.          between a pair of BGP peers, and to authenticate incoming BGP
  364.          messages.
  365.  
  366.  
  367.       Length:
  368.  
  369.          This 2-octet unsigned integer indicates the total length of the
  370.          message, including the header, in octets.  Thus, e.g., it
  371.          allows one to locate in the transport-level stream the (Marker
  372.          field of the) next message.  The value of the Length field must
  373.          always be at least 19 and no greater than 4096, and may be
  374.          further constrained, depending on the message type.  No
  375.          "padding" of extra data after the message is allowed, so the
  376.          Length field must have the smallest value required given the
  377.          rest of the message.
  378.  
  379.       Type:
  380.  
  381.          This 1-octet unsigned integer indicates the type code of the
  382.          message.  The following type codes are defined:
  383.  
  384.                                     1 - OPEN
  385.                                     2 - UPDATE
  386.                                     3 - NOTIFICATION
  387.  
  388.  
  389.  
  390. Expiration Date January 1994                                    [Page 7]
  391.  
  392. INTERNET DRAFT                                                April 1993
  393.  
  394.  
  395.                                     4 - KEEPALIVE
  396.  
  397.  
  398. 4.2 OPEN Message Format
  399.  
  400.  
  401.    After a transport protocol connection is established, the first
  402.    message sent by each side is an OPEN message.  If the OPEN message is
  403.    acceptable, a KEEPALIVE message confirming the OPEN is sent back.
  404.    Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION
  405.    messages may be exchanged.
  406.  
  407.    In addition to the fixed-size BGP header, the OPEN message contains
  408.    the following fields:
  409.  
  410.  
  411.  
  412.  
  413.         0                   1                   2                   3
  414.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  415.        +-+-+-+-+-+-+-+-+
  416.        |    Version    |
  417.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  418.        |     My Autonomous System      |
  419.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  420.        |           Hold Time           |
  421.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  422.        |                         BGP Identifier                        |
  423.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  424.        |  Auth. Code   |
  425.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  426.        |                                                               |
  427.        |                       Authentication Data                     |
  428.        |                                                               |
  429.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  430.  
  431.  
  432.  
  433.       Version:
  434.  
  435.          This 1-octet unsigned integer indicates the protocol version
  436.          number of the message.  The current BGP version number is 4.
  437.  
  438.       My Autonomous System:
  439.  
  440.          This 2-octet unsigned integer indicates the Autonomous System
  441.          number of the sender.
  442.  
  443.  
  444.  
  445.  
  446. Expiration Date January 1994                                    [Page 8]
  447.  
  448. INTERNET DRAFT                                                April 1993
  449.  
  450.  
  451.       Hold Time:
  452.  
  453.          This 2-octet unsigned integer indicates the number of seconds that the
  454.          sender proposes for the value of the Hold Timer.  Upon receipt of an OPEN
  455.          message, a BGP speaker MUST calculate the value of the Hold Timer by using
  456.          the smaller of its configured Hold Time and the Hold Time received in the
  457.          OPEN message.  The Hold Time MUST be at least three seconds.
  458.  
  459.       BGP Identifier:
  460.          This 4-octet unsigned integer indicates the BGP Identifier of
  461.          the sender. A given BGP speaker sets the value of its BGP
  462.          Identifier to an IP address assigned to that BGP speaker.
  463.          The value of the BGP Identifier is determined on startup
  464.          and is the same for every local interface and every BGP peer.
  465.  
  466.       Authentication Code:
  467.  
  468.          This 1-octet unsigned integer indicates the authentication
  469.          mechanism being used.  Whenever an authentication mechanism is
  470.          specified for use within BGP, three things must be included in the
  471.          specification:
  472.          - the value of the Authentication Code which indicates use of
  473.          the mechanism,
  474.          - the form and meaning of the Authentication Data, and
  475.          - the algorithm for computing values of Marker fields.
  476.          Only one authentication mechanism is specified as part of this
  477.          memo:
  478.          - its Authentication Code is zero,
  479.          - its Authentication Data must be empty (of zero length), and
  480.          - the Marker fields of all messages must be all ones.
  481.          The semantics of non-zero Authentication Codes lies outside the
  482.          scope of this memo.
  483.  
  484.          Note that a separate authentication mechanism may be used in
  485.          establishing the transport level connection.
  486.  
  487.       Authentication Data:
  488.  
  489.          The form and meaning of this field is a variable-length field
  490.          depend on the Authentication Code.  If the value of Authentication
  491.          Code field is zero, the Authentication Data field must have zero
  492.          length.  The semantics of the non-zero length Authentication Data
  493.          field is outside the scope of this memo.
  494.  
  495.          Note that the length of the Authentication Data field can be
  496.          determined from the message Length field by the formula:
  497.  
  498.             Message Length = 29 + Authentication Data Length
  499.  
  500.  
  501.  
  502. Expiration Date January 1994                                    [Page 9]
  503.  
  504. INTERNET DRAFT                                                April 1993
  505.  
  506.  
  507.          The minimum length of the OPEN message is 29 octets (including
  508.          message header).
  509.  
  510.  
  511. 4.3 UPDATE Message Format
  512.  
  513.  
  514.    UPDATE messages are used to transfer routing information between BGP
  515.    peers.  The information in the UPDATE packet can be used to construct
  516.    a graph describing the relationships of the various Autonomous
  517.    Systems.  By applying rules to be discussed, routing information
  518.    loops and some other anomalies may be detected and removed from
  519.    inter-AS routing.
  520.  
  521.    An UPDATE message is used to advertise a single feasible route to a
  522.    neighboring BGP speaker, or to withdraw multiple unfeasible routes
  523.    from service (see 3.1). An UPDATE message may simultaneously advertise
  524.    a feasible route and withdraw multiple unfeasible routes from service.
  525.    The UPDATE message always includes the fixed-size BGP header,
  526.    and can optionally include the other fields as shown below:
  527.  
  528.  
  529.       +-----------------------------------------------------+
  530.       |   Unfeasible Routes Length (2 octets)               |
  531.       +-----------------------------------------------------+
  532.       |  Withdrawn Routes (variable)                        |
  533.       +-----------------------------------------------------+
  534.       |   Total Path Attribute Length (2 octets)            |
  535.       +-----------------------------------------------------+
  536.       |    Path Attributes (variable)                       |
  537.       +-----------------------------------------------------+
  538.       |   Network Layer Reachability Information (variable) |
  539.       +-----------------------------------------------------+
  540.  
  541.  
  542.  
  543.       Unfeasible Routes Length:
  544.  
  545.          This 2-octets unsigned integer indicates the total length of
  546.          the Withdrawn Routes field in octets.  Its value must allow the
  547.          length of the Network Layer Reachability Information field to
  548.          be determined as specified below.
  549.  
  550.          A value of 0 indicates that no routes are being withdrawn from
  551.          service, and that the WITHDRAWN ROUTES field is not present in
  552.          this UPDATE message.
  553.  
  554.       Withdrawn Routes:
  555.  
  556.  
  557.  
  558. Expiration Date January 1994                                   [Page 10]
  559.  
  560. INTERNET DRAFT                                                April 1993
  561.  
  562.  
  563.          This is a variable length field that contains a list of IP
  564.          address prefixes for the routes that are being withdrawn from
  565.          service.  Each IP address prefix is encoded as a 2-tuple of the
  566.          form <length, prefix>, whose fields are described below:
  567.  
  568.                   +---------------------------+
  569.                   |   Length (1 octet)        |
  570.                   +---------------------------+
  571.                   |   Prefix (variable)       |
  572.                   +---------------------------+
  573.  
  574.  
  575.          The use and the meaning of these fields are as follows:
  576.  
  577.          a) Length:
  578.  
  579.             The Length field indicates the length in bits of the IP
  580.             address prefix. A length of zero indicates a prefix that
  581.             matches all IP addresses (with prefix, itself, of zero
  582.             octets).
  583.  
  584.          b) Prefix:
  585.  
  586.             The Prefix field contains IP address prefixes followed by
  587.             enough trailing bits to make the end of the field fall on an
  588.             octet boundary. Note that the value of trailing bits is
  589.             irrelevant.
  590.  
  591.       Total Path Attribute Length:
  592.  
  593.          This 2-octet unsigned integer indicates the total length of the
  594.          Path Attributes field in octets.  Its value must allow the
  595.          length of the Network Layer Reachability field to be determined
  596.          as specified below.
  597.  
  598.          A value of 0 indicates that no Network Layer Reachability
  599.          Information field is present in this UPDATE message.
  600.  
  601.       Path Attributes:
  602.  
  603.          A variable length sequence of path attributes is present in
  604.          every UPDATE.  Each path attribute is a triple <attribute type,
  605.          attribute length, attribute value> of variable length.
  606.  
  607.          Attribute Type is a two-octet field that consists of the
  608.          Attribute Flags octet followed by the Attribute Type Code
  609.          octet.
  610.  
  611.  
  612.  
  613.  
  614. Expiration Date January 1994                                   [Page 11]
  615.  
  616. INTERNET DRAFT                                                April 1993
  617.  
  618.  
  619.                 0                   1
  620.                 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  621.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  622.                |  Attr. Flags  |Attr. Type Code|
  623.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  624.  
  625.  
  626.          The high-order bit (bit 0) of the Attribute Flags octet is the
  627.          Optional bit.  It defines whether the attribute is optional (if
  628.          set to 1) or well-known (if set to 0).
  629.  
  630.          The second high-order bit (bit 1) of the Attribute Flags octet
  631.          is the Transitive bit.  It defines whether an optional
  632.          attribute is transitive (if set to 1) or non-transitive (if set
  633.          to 0).  For well-known attributes, the Transitive bit must be
  634.          set to 1.  (See Section 5 for a discussion of transitive
  635.          attributes.)
  636.  
  637.          The third high-order bit (bit 2) of the Attribute Flags octet
  638.          is the Partial bit.  It defines whether the information
  639.          contained in the optional transitive attribute is partial (if
  640.          set to 1) or complete (if set to 0).  For well-known attributes
  641.          and for optional non-transitive attributes the Partial bit must
  642.          be set to 0.
  643.  
  644.          The fourth high-order bit (bit 3) of the Attribute Flags octet
  645.          is the Extended Length bit.  It defines whether the Attribute
  646.          Length is one octet (if set to 0) or two octets (if set to 1).
  647.          Extended Length may be used only if the length of the attribute
  648.          value is greater than 255 octets.
  649.  
  650.          The lower-order four bits of the Attribute Flags octet are .
  651.          unused. They must be zero (and must be ignored when received).
  652.  
  653.          The Attribute Type Code octet contains the Attribute Type Code.
  654.          Currently defined Attribute Type Codes are discussed in Section
  655.          5.
  656.  
  657.          If the Extended Length bit of the Attribute Flags octet is set
  658.          to 0, the third octet of the Path Attribute contains the length
  659.          of the attribute data in octets.
  660.  
  661.          If the Extended Length bit of the Attribute Flags octet is set
  662.          to 1, then the third and the fourth octets of the path
  663.          attribute contain the length of the attribute data in octets.
  664.  
  665.          The remaining octets of the Path Attribute represent the
  666.          attribute value and are interpreted according to the Attribute
  667.  
  668.  
  669.  
  670. Expiration Date January 1994                                   [Page 12]
  671.  
  672. INTERNET DRAFT                                                April 1993
  673.  
  674.  
  675.          Flags and the Attribute Type Code. The supported attribute
  676.          values and their uses are the following:
  677.  
  678.          a)   ORIGIN (Type Code 1):
  679.  
  680.             ORIGIN is a well-known mandatory attribute that defines the
  681.             origin of the path information.   The data octet can assume
  682.             the following values:
  683.  
  684.                   Value      Meaning
  685.  
  686.                   0         IGP - Network Layer Reachability Information
  687.                                is interior to the originating AS
  688.  
  689.                   1         EGP - Network Layer Reachability Information
  690.                                learned via EGP
  691.  
  692.                   2         INCOMPLETE - Network Layer Reachability
  693.                                Information learned by some other means
  694.  
  695.             Its usage is defined in 5.1.1
  696.  
  697.          b) AS_PATH (Type Code 2):
  698.  
  699.             AS_PATH is a well-known mandatory attribute that is composed
  700.             of a sequence of AS path segments. Each AS path segment is
  701.             represented by a triple <path segment type, path segment
  702.             length, path segment value>.
  703.  
  704.             The path segment type is a 1-octet long field with the
  705.             following values defined:
  706.  
  707.                   Value      Segment Type
  708.  
  709.                   1         AS_SET: unordered set of ASs a route in the
  710.                                UPDATE message has traversed
  711.  
  712.                   2         AS_SEQUENCE: ordered set of ASs a route in
  713.                                the UPDATE message has traversed
  714.  
  715.             The path segment length is a 1-octet long field containing
  716.             the number of ASs in the path segment value field.
  717.  
  718.             The path segment value field contains one or more AS
  719.             numbers, each encoded as a 2-octets long field.
  720.  
  721.             Usage of this attribute is defined in 5.1.2.
  722.  
  723.  
  724.  
  725.  
  726. Expiration Date January 1994                                   [Page 13]
  727.  
  728. INTERNET DRAFT                                                April 1993
  729.  
  730.  
  731.          c)   NEXT_HOP (Type Code 3):
  732.  
  733.             This is a well-known mandatory attribute that defines the IP
  734.             address of the border router that should be used as the next
  735.             hop to the destinations listed in the Network Layer
  736.             Reachability field of the UPDATE message.
  737.  
  738.             Usage of this attribute is defined in 5.1.3.
  739.  
  740.  
  741.          d) MULTI_EXIT_DISC (Type Code 4):
  742.  
  743.             This is an optional non-transitive attribute that is a four
  744.             octet non-negative integer. The value of this attribute may
  745.             be used by a BGP speaker's decision process to discriminate
  746.             between multiple exit points to an adjacent autonomous
  747.             system.
  748.  
  749.             Its usage is defined in 5.1.4.
  750.  
  751.          e) LOCAL_PREF (Type Code 5):
  752.  
  753.             LOCAL_PREF is a well-known discretionary attribute that is a
  754.             four octet non-negative integer. It is used by a BGP speaker
  755.             to inform other BGP speakers in its own autonomous system of
  756.             the originating speaker's degree of preference for an
  757.             advertised route. Usage of this attribute is described in
  758.             5.1.5.
  759.  
  760.          f) ATOMIC_AGGREGATE (Type Code 6)
  761.  
  762.             ATOMIC_AGGREGATE is a well-known discretionary attribute of
  763.             length 0. It is used by a BGP speaker to inform other BGP
  764.             speakers that the local system selected a less specific
  765.             route without selecting a more specific route which is
  766.             included in it. Usage of this attribute is described in
  767.             5.1.6.
  768.  
  769.          g) AGGREGATOR (Type Code 7)
  770.  
  771.             AGGREGATOR is an optional transitive attribute of length 2.
  772.             It is used by a BGP speaker to to indicate the AS number of
  773.             the last AS that formed the aggregate route.  Usage of this
  774.             attribute is described in 5.1.7
  775.  
  776.       Network Layer Reachability Information:
  777.  
  778.          This variable length field contains a list of IP address
  779.  
  780.  
  781.  
  782. Expiration Date January 1994                                   [Page 14]
  783.  
  784. INTERNET DRAFT                                                April 1993
  785.  
  786.  
  787.          prefixes.  The length in octets of the Network Layer
  788.          Reachability Information is not encoded explicitly, but can be
  789.          calculated as:
  790.  
  791.             UPDATE message Length - 23 - Total Path Attributes Length -
  792.             Unfeasible Routes Length
  793.  
  794.          where UPDATE message Length is the value encoded in the fixed-
  795.          size BGP header, Total Path Attribute Length and Unfeasible
  796.          Routes Length  are the values encoded in the variable part of
  797.          the UPDATE message, and 23 is a combined length of the fixed-
  798.          size BGP header, the Total Path Attribute Length field and the
  799.          Unfeasible Routes Length field.
  800.  
  801.          Reachability information is encoded as one or more 2-tuples of
  802.          the form <length, prefix>, whose fields are described below:
  803.  
  804.  
  805.                   +---------------------------+
  806.                   |   Length (1 octet)        |
  807.                   +---------------------------+
  808.                   |   Prefix (variable)       |
  809.                   +---------------------------+
  810.  
  811.  
  812.          The use and the meaning of these fields are as follows:
  813.  
  814.          a) Length:
  815.  
  816.             The Length field indicates the length in bits of the IP
  817.             address prefix. A length of zero indicates a prefix that
  818.             matches all IP addresses (with prefix, itself, of zero
  819.             octets).
  820.  
  821.          b) Prefix:
  822.  
  823.             The Prefix field contains IP address prefixes followed by
  824.             enough trailing bits to make the end of the field fall on an
  825.             octet boundary. Note that the value of the trailing bits is
  826.             irrelevant.
  827.  
  828.    The minimum length of the UPDATE message is 33 octets (including
  829.    message header).
  830.  
  831.  
  832.    An UPDATE message can advertise at most one route, which may be
  833.    described by several path attributes. All path attributes contained
  834.    in a given UPDATE messages apply to the destinations carried in the
  835.  
  836.  
  837.  
  838. Expiration Date January 1994                                   [Page 15]
  839.  
  840. INTERNET DRAFT                                                April 1993
  841.  
  842.  
  843.    Network Layer Reachability Information field of the UPDATE message.
  844.  
  845.    An UPDATE message can list multiple routes to be withdrawn from
  846.    service.  Each such route is identified by its destination (expressed
  847.    as an IP prefix), which unambiguously identifies the route in the
  848.    context of the BGP speaker - BGP speaker connection to which it has
  849.    been previously been advertised.
  850.  
  851.    An UPDATE message may advertise only routes to be withdrawn from
  852.    service, in which case it will not include path attributes or Network
  853.    Layer Reachability Information. Conversely, it may advertise only a
  854.    feasible route, in which case the WITHDRAWN ROUTES field need not be
  855.    present.
  856.  
  857.  
  858. 4.4 KEEPALIVE Message Format
  859.  
  860.  
  861.    BGP does not use any transport protocol-based keep-alive mechanism to
  862.    determine if peers are reachable.  Instead, KEEPALIVE messages are
  863.    exchanged between peers often enough as not to cause the Hold Timer
  864.    to expire.  A reasonable maximum time between KEEPALIVE messages
  865.    would be one third of the Hold Time interval.  KEEPALIVE messages
  866.    MUST NOT be sent more frequently than one per second.  An
  867.    implementation MAY adjust the rate at which it sends KEEPALIVE
  868.    messages as a function of the Hold Time interval.
  869.  
  870.    KEEPALIVE message consists of only message header and has a length of
  871.    19 octets.
  872.  
  873.  
  874. 4.5 NOTIFICATION Message Format
  875.  
  876.  
  877.    A NOTIFICATION message is sent when an error condition is detected.
  878.    The BGP connection is closed immediately after sending it.
  879.  
  880.    In addition to the fixed-size BGP header, the NOTIFICATION message
  881.    contains the following fields:
  882.  
  883.  
  884.         0                   1                   2                   3
  885.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  886.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  887.        | Error code    | Error subcode |           Data                |
  888.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
  889.        |                                                               |
  890.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  891.  
  892.  
  893.  
  894. Expiration Date January 1994                                   [Page 16]
  895.  
  896. INTERNET DRAFT                                                April 1993
  897.  
  898.  
  899.       Error Code:
  900.  
  901.          This 1-octet unsigned integer indicates the type of
  902.          NOTIFICATION.  The following Error Codes have been defined:
  903.  
  904.             Error Code       Symbolic Name               Reference
  905.  
  906.               1         Message Header Error             Section 6.1
  907.  
  908.               2         OPEN Message Error               Section 6.2
  909.  
  910.               3         UPDATE Message Error             Section 6.3
  911.  
  912.               4         Hold Timer Expired               Section 6.5
  913.  
  914.               5         Finite State Machine Error       Section 6.6
  915.  
  916.               6         Cease                            Section 6.7
  917.  
  918.  
  919.       Error subcode:
  920.  
  921.          This 1-octet unsigned integer provides more specific
  922.          information about the nature of the reported error.  Each Error
  923.          Code may have one or more Error Subcodes associated with it.
  924.          If no appropriate Error Subcode is defined, then a zero
  925.          (Unspecific) value is used for the Error Subcode field.
  926.  
  927.          Message Header Error subcodes:
  928.  
  929.                                1  - Connection Not Synchronized.
  930.                                2  - Bad Message Length.
  931.                                3  - Bad Message Type.
  932.  
  933.          OPEN Message Error subcodes:
  934.  
  935.                                1  - Unsupported Version Number.
  936.                                2  - Bad Peer AS.
  937.                                3  - Bad BGP Identifier.
  938.                                4  - Unsupported Authentication Code.
  939.                                5  - Authentication Failure.
  940.  
  941.          UPDATE Message Error subcodes:
  942.  
  943.                                1 - Malformed Attribute List.
  944.                                2 - Unrecognized Well-known Attribute.
  945.                                3 - Missing Well-known Attribute.
  946.                                4 - Attribute Flags Error.
  947.  
  948.  
  949.  
  950. Expiration Date January 1994                                   [Page 17]
  951.  
  952. INTERNET DRAFT                                                April 1993
  953.  
  954.  
  955.                                5 - Attribute Length Error.
  956.                                6 - Invalid ORIGIN Attribute
  957.                                7 - AS Routing Loop.
  958.                                8 - Invalid NEXT_HOP Attribute.
  959.                                9 - Optional Attribute Error.
  960.                               10 - Invalid Network Field.
  961.                               11 - Malformed AS_PATH.
  962.  
  963.       Data:
  964.  
  965.          This variable-length field is used to diagnose the reason for
  966.          the NOTIFICATION.  The contents of the Data field depend upon
  967.          the Error Code and Error Subcode.  See Section 6 below for more
  968.          details.
  969.  
  970.          Note that the length of the Data field can be determined from
  971.          the message Length field by the formula:
  972.  
  973.                   Message Length = 21 + Data Length
  974.  
  975.  
  976.    The minimum length of the NOTIFICATION message is 21 octets
  977.    (including message header).
  978.  
  979.  
  980. 5.  Path Attributes
  981.  
  982.  
  983.    This section discusses the path attributes of the UPDATE message.
  984.  
  985.    Path attributes fall into four separate categories:
  986.  
  987.                1. Well-known mandatory.
  988.                2. Well-known discretionary.
  989.                3. Optional transitive.
  990.                4. Optional non-transitive.
  991.  
  992.    Well-known attributes must be recognized by all BGP implementations.
  993.    Some of these attributes are mandatory and must be included in every
  994.    UPDATE message.  Others are discretionary and may or may not be sent
  995.    in a particular UPDATE message.
  996.  
  997.    All well-known attributes must be passed along (after proper
  998.    updating, if necessary) to other BGP peers.
  999.  
  1000.    In addition to well-known attributes, each path may contain one or
  1001.    more optional attributes.  It is not required or expected that all
  1002.    BGP implementations support all optional attributes.  The handling of
  1003.  
  1004.  
  1005.  
  1006. Expiration Date January 1994                                   [Page 18]
  1007.  
  1008. INTERNET DRAFT                                                April 1993
  1009.  
  1010.  
  1011.    an unrecognized optional attribute is determined by the setting of
  1012.    the Transitive bit in the attribute flags octet.  Paths with
  1013.    unrecognized transitive optional attributes should be accepted. If a
  1014.    path with unrecognized transitive optional attribute is accepted and
  1015.    passed along to other BGP peers, then the unrecognized transitive
  1016.    optional attribute of that path must be passed along with the path to
  1017.    other BGP peers with the Partial bit in the Attribute Flags octet set
  1018.    to 1. If a path with recognized transitive optional attribute is
  1019.    accepted and passed along to other BGP peers and the Partial bit in
  1020.    the Attribute Flags octet is set to 1 by some previous AS, it is not
  1021.    set back to 0 by the current AS. Unrecognized non-transitive optional
  1022.    attributes must be quietly ignored and not passed along to other BGP
  1023.    peers.
  1024.  
  1025.    New transitive optional attributes may be attached to the path by the
  1026.    originator or by any other AS in the path.  If they are not attached
  1027.    by the originator, the Partial bit in the Attribute Flags octet is
  1028.    set to 1.  The rules for attaching new non-transitive optional
  1029.    attributes will depend on the nature of the specific attribute.  The
  1030.    documentation of each new non-transitive optional attribute will be
  1031.    expected to include such rules.  (The description of the
  1032.    MULTI_EXIT_DISC attribute gives an example.)  All optional attributes
  1033.    (both transitive and non-transitive) may be updated (if appropriate)
  1034.    by ASs in the path.
  1035.  
  1036.    The sender of an UPDATE message should order path attributes within
  1037.    the UPDATE message in ascending order of attribute type.  The
  1038.    receiver of an UPDATE message must be prepared to handle path
  1039.    attributes within the UPDATE message that are out of order.
  1040.  
  1041.    The same attribute cannot appear more than once within the Path
  1042.    Attributes field of a particular UPDATE message.
  1043.  
  1044.  
  1045.  
  1046. 5.1 Path Attribute Usage
  1047.  
  1048.  
  1049.    The usage of each BGP path attributes is described in the following
  1050.    clauses.
  1051.  
  1052.  
  1053.  
  1054. 5.1.1 ORIGIN
  1055.  
  1056.  
  1057.    ORIGIN is a well-known mandatory attribute. The ORIGIN attribute
  1058.    shall be generated by the autonomous system that originates the
  1059.  
  1060.  
  1061.  
  1062. Expiration Date January 1994                                   [Page 19]
  1063.  
  1064. INTERNET DRAFT                                                April 1993
  1065.  
  1066.  
  1067.    associated routing information. It shall be included in the UPDATE
  1068.    messages of all BGP speakers that choose to propagate this
  1069.    information to other BGP speakers.
  1070.  
  1071.  
  1072. 5.1.2   AS_PATH
  1073.  
  1074.  
  1075.    AS_PATH is a well-known mandatory attribute. This attribute
  1076.    identifies the autonomous systems through which routing information
  1077.    carried in this UPDATE message has passed. The components of this
  1078.    list can be AS_SETs or AS_SEQUENCEs.
  1079.  
  1080.    When a BGP speaker propagates a route which it has learned from
  1081.    another BGP speaker's UPDATE message, it shall modify the route's
  1082.    AS_PATH attribute based on the location of the BGP speaker to which
  1083.    the route will be sent:
  1084.  
  1085.       a) When a given BGP speaker advertises the route to another BGP
  1086.       speaker located in its own autonomous system, the advertising
  1087.       speaker shall not modify the AS_PATH attribute associated with the
  1088.       route.
  1089.  
  1090.       b) When a given BGP speaker advertises the route to a BGP speaker
  1091.       located in an adjacent autonomous system, then the advertising
  1092.       speaker shall update the AS_PATH attribute as follows:
  1093.  
  1094.          1) if the first path segment of the AS_PATH is of type
  1095.          AS_SEQUENCE, the local system shall prepend its own AS number
  1096.          as the last element of the sequence  (put it in the leftmost
  1097.          position)
  1098.  
  1099.          2) if the first path segment of the AS_PATH is of type AS_SET,
  1100.          the local system shall prepend a new path segment of type
  1101.          AS_SEQUENCE to the AS_PATH, including its own AS number in that
  1102.          segment.
  1103.  
  1104.       When a BGP speaker originates a route then:
  1105.  
  1106.  
  1107.          a) the originating speaker shall include its own AS number in
  1108.          the AS_PATH attribute of all UPDATE messages sent to BGP
  1109.          speakers located in adjacent autonomous systems. (In this case,
  1110.          the AS number of the originating speaker's autonomous system
  1111.          will be the only entry in the AS_PATH attribute).
  1112.  
  1113.          b) the originating speaker shall include an empty AS_PATH
  1114.          attribute in all UPDATE messages sent to BGP speakers located
  1115.  
  1116.  
  1117.  
  1118. Expiration Date January 1994                                   [Page 20]
  1119.  
  1120. INTERNET DRAFT                                                April 1993
  1121.  
  1122.  
  1123.          in its own autonomous system. (An empty AS_PATH attribute is
  1124.          one whose length field contains the value zero).
  1125.  
  1126.  
  1127. 5.1.3 NEXT_HOP
  1128.  
  1129.  
  1130.    The NEXT_HOP path attribute defines the IP address of the border
  1131.    router that should be used as the next hop to the networks listed in
  1132.    the UPDATE message.  If a border router belongs to the same AS as its
  1133.    peer, then the peer is an internal border router. Otherwise, it is an
  1134.    external border router.  A BGP speaker can advertise any internal
  1135.    border router as the next hop provided that the interface associated
  1136.    with the IP address of this border router (as specified in the
  1137.    NEXT_HOP path attribute) shares a common subnet with both the local
  1138.    and remote BGP speakers. A BGP speaker can advertise any external
  1139.    border router as the next hop, provided that the IP address of this
  1140.    border router was learned from one of the BGP speaker's peers, and
  1141.    the interface associated with the IP address of this border router
  1142.    (as specified in the NEXT_HOP path attribute) shares a common subnet
  1143.    with the local and remote BGP speakers.  A BGP speaker needs to be
  1144.    able to support disabling advertisement of external border routers.
  1145.  
  1146.    A BGP speaker must never advertise an address of a neighbor to that
  1147.    neighbor as a NEXT_HOP, for a route that the speaker is originating.
  1148.    A BGP speaker must never install a route with itself as the next hop.
  1149.  
  1150.    When a BGP speaker advertises the route to a BGP speaker located in
  1151.    its own autonomous system, the advertising speaker shall not modify
  1152.    the NEXT_HOP attribute associated with the route.  When a BGP speaker
  1153.    receives the route via an internal link, it may use that NEXT_HOP if
  1154.    the address contained in the attribute is on a common subnet with the
  1155.    local and remote BGP speakers.  The BGP speaker may also use the
  1156.    NEXT_HOP address if the IGP does not contain a route for the
  1157.    destination.
  1158.  
  1159.  
  1160. 5.1.4   MULTI_EXIT_DISC
  1161.  
  1162.  
  1163.    The MULTI_EXIT_DISC attribute may be used on external (inter-AS)
  1164.    links to discriminate between multiple exit or entry points to the
  1165.    same neighboring AS.  The value of the MULTI_EXIT_DISC attribute is a
  1166.    four octet unsigned number which is called a metric.  All other
  1167.    factors being equal, the exit or entry point with lower metric should
  1168.    be preferred.  If received over external links, the MULTI_EXIT_DISC
  1169.    attribute may be propagated over internal links to other BGP speakers
  1170.    within the same AS.  The MULTI_EXIT_DISC attribute is never
  1171.  
  1172.  
  1173.  
  1174. Expiration Date January 1994                                   [Page 21]
  1175.  
  1176. INTERNET DRAFT                                                April 1993
  1177.  
  1178.  
  1179.    propagated to other BGP speakers in neighboring AS's.
  1180.  
  1181.  
  1182. 5.1.5   LOCAL_PREF
  1183.  
  1184.  
  1185.    LOCAL_PREF is a well-known discretionary attribute that shall be
  1186.    included in all UPDATE messages that a given BGP speaker sends to the
  1187.    other BGP speakers located in its own autonomous system. A BGP
  1188.    speaker shall calculate the degree of preference for each external
  1189.    route and include the degree of preference when advertising a route
  1190.    to its internal neighbors. The higher degree of preference should be
  1191.    preferred. A BGP speaker shall use the degree of preference learned
  1192.    via LOCAL_PREF in its decision process (see section 9.1.1).
  1193.  
  1194.    A BGP speaker shall not include this attribute in UPDATE messages
  1195.    that it sends to BGP speakers located in an adjacent autonomous
  1196.    system. It is contained in an UPDATE message that is received from a
  1197.    BGP speaker which is not located in the same autonomous system as the
  1198.    receiving speaker, then this attribute shall be ignored by the
  1199.    receiving speaker.
  1200.  
  1201.  
  1202. 5.1.6   ATOMIC_AGGREGATE
  1203.  
  1204.  
  1205.    ATOMIC_AGGREGATE is a well-known discretionary attribute.  If a BGP
  1206.    speaker, when presented with a set of overlapping routes from one of
  1207.    its peers (see 9.1.4), selects the less specific route without
  1208.    selecting the more specific one, then the local system shall attach
  1209.    the ATOMIC_AGGREGATE attribute to the route when propagating it to
  1210.    other BGP speakers (if that attribute is not already present in the
  1211.    received less specific route). A BGP speaker that receives a route
  1212.    with the ATOMIC_AGGREGATE attribute shall not remove the attribute
  1213.    from the route when propagating it to other speakers. A BGP speaker
  1214.    that receives a route with the ATOMIC_AGGREGATE attribute shall not
  1215.    make any NLRI of that route more specific (as defined in 9.1.4) when
  1216.    advertising this route to other BGP speakers.  A BGP speaker that
  1217.    receives a route with the ATOMIC_AGGREGATE attribute needs to be
  1218.    cognizant of the fact that the actual path to destinations, as
  1219.    specified in the NLRI of the route, while having the loop-free
  1220.    property, may traverse ASs that are not listed in the AS_PATH
  1221.    attribute.
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230. Expiration Date January 1994                                   [Page 22]
  1231.  
  1232. INTERNET DRAFT                                                April 1993
  1233.  
  1234.  
  1235. 5.1.7   AGGREGATOR
  1236.  
  1237.  
  1238.    AGGREGATOR is an optional transitive attribute which may be included
  1239.    in updates which are formed by aggregation (see Section 9.2.4.2).  A
  1240.    BGP speaker which performs route aggregation may add the AGGREGATOR
  1241.    attribute which shall contain its own AS number.
  1242.  
  1243.  
  1244. 6.  BGP Error Handling.
  1245.  
  1246.  
  1247.    This section describes actions to be taken when errors are detected
  1248.    while processing BGP messages.
  1249.  
  1250.    When any of the conditions described here are detected, a
  1251.    NOTIFICATION message with the indicated Error Code, Error Subcode,
  1252.    and Data fields is sent, and the BGP connection is closed.  If no
  1253.    Error Subcode is specified, then a zero must be used.
  1254.  
  1255.    The phrase "the BGP connection is closed" means that the transport
  1256.    protocol connection has been closed and that all resources for that
  1257.    BGP connection have been deallocated.  Routing table entries
  1258.    associated with the remote peer are marked as invalid.  The fact that
  1259.    the routes have become invalid is passed to other BGP peers before
  1260.    the routes are deleted from the system.
  1261.  
  1262.    Unless specified explicitly, the Data field of the NOTIFICATION
  1263.    message that is sent to indicate an error is empty.
  1264.  
  1265.  
  1266. 6.1 Message Header error handling.
  1267.  
  1268.  
  1269.    All errors detected while processing the Message Header are indicated
  1270.    by sending the NOTIFICATION message with Error Code Message Header
  1271.    Error.  The Error Subcode elaborates on the specific nature of the
  1272.    error.
  1273.  
  1274.    The expected value of the Marker field of the message header is all
  1275.    ones if the message type is OPEN.  The expected value of the Marker
  1276.    field for all other types of BGP messages determined based on the
  1277.    Authentication Code in the BGP OPEN message and the actual
  1278.    authentication mechanism (if the Authentication Code in the BGP OPEN
  1279.    message is non-zero). If the Marker field of the message header is
  1280.    not the expected one, then a synchronization error has occurred and
  1281.    the Error Subcode is set to Connection Not Synchronized.
  1282.  
  1283.  
  1284.  
  1285.  
  1286. Expiration Date January 1994                                   [Page 23]
  1287.  
  1288. INTERNET DRAFT                                                April 1993
  1289.  
  1290.  
  1291.    If the Length field of the message header is less than 19 or greater
  1292.    than 4096, or if the Length field of an OPEN message is less  than
  1293.    the minimum length of the OPEN message, or if the Length field of an
  1294.    UPDATE message is less than the minimum length of the UPDATE message,
  1295.    or if the Length field of a KEEPALIVE message is not equal to 19, or
  1296.    if the Length field of a NOTIFICATION message is less than the
  1297.    minimum length of the NOTIFICATION message, then the Error Subcode is
  1298.    set to Bad Message Length.  The Data field contains the erroneous
  1299.    Length field.
  1300.  
  1301.    If the Type field of the message header is not recognized, then the
  1302.    Error Subcode is set to Bad Message Type.  The Data field contains
  1303.    the erroneous Type field.
  1304.  
  1305.  
  1306. 6.2 OPEN message error handling.
  1307.  
  1308.  
  1309.    All errors detected while processing the OPEN message are indicated
  1310.    by sending the NOTIFICATION message with Error Code OPEN Message
  1311.    Error.  The Error Subcode elaborates on the specific nature of the
  1312.    error.
  1313.  
  1314.    If the version number contained in the Version field of the received
  1315.    OPEN message is not supported, then the Error Subcode is set to
  1316.    Unsupported Version Number.  The Data field is a 2-octet unsigned
  1317.    integer, which indicates the largest locally supported version number
  1318.    less than the version the remote BGP peer bid (as indicated in the
  1319.    received OPEN message).
  1320.  
  1321.    If the Autonomous System field of the OPEN message is unacceptable,
  1322.    then the Error Subcode is set to Bad Peer AS.  The determination of
  1323.    acceptable Autonomous System numbers is outside the scope of this
  1324.    protocol.
  1325.  
  1326.    If the BGP Identifier field of the OPEN message is syntactically
  1327.    incorrect, then the Error Subcode is set to Bad BGP Identifier.
  1328.    Syntactic correctness means that the BGP Identifier field represents
  1329.    a valid IP host address.
  1330.  
  1331.    If the Authentication Code of the OPEN message is not recognized,
  1332.    then the Error Subcode is set to Unsupported Authentication Code.  If
  1333.    the Authentication Code is zero, then the Authentication Data must be
  1334.    of zero length.  Otherwise, the Error Subcode is set to
  1335.    Authentication Failure.
  1336.  
  1337.    If the Authentication Code is non-zero, then the corresponding
  1338.    authentication procedure is invoked.  If the authentication procedure
  1339.  
  1340.  
  1341.  
  1342. Expiration Date January 1994                                   [Page 24]
  1343.  
  1344. INTERNET DRAFT                                                April 1993
  1345.  
  1346.  
  1347.    (based on Authentication Code and Authentication Data) fails, then
  1348.    the Error Subcode is set to Authentication Failure.
  1349.  
  1350.  
  1351. 6.3 UPDATE message error handling.
  1352.  
  1353.  
  1354.    All errors detected while processing the UPDATE message are indicated
  1355.    by sending the NOTIFICATION message with Error Code UPDATE Message
  1356.    Error.  The error subcode elaborates on the specific nature of the
  1357.    error.
  1358.  
  1359.    Error checking of an UPDATE message begins by examining the path
  1360.    attributes.  If the Total Attribute Length is too large (i.e., if
  1361.    Total Attribute Length + 21 exceeds the message Length), or if the
  1362.    (non-negative integer) Number of Network fields cannot be computed as
  1363.    in Section 4.3, then the Error Subcode is set to Malformed Attribute
  1364.    List.
  1365.  
  1366.    If any recognized attribute has Attribute Flags that conflict with
  1367.    the Attribute Type Code, then the Error Subcode is set to Attribute
  1368.    Flags Error.  The Data field contains the erroneous attribute (type,
  1369.    length and value).
  1370.  
  1371.    If any recognized attribute has Attribute Length that conflicts with
  1372.    the expected length (based on the attribute type code), then the
  1373.    Error Subcode is set to Attribute Length Error.  The Data field
  1374.    contains the erroneous attribute (type, length and value).
  1375.  
  1376.    If any of the mandatory well-known attributes are not present, then
  1377.    the Error Subcode is set to Missing Well-known Attribute.  The Data
  1378.    field contains the Attribute Type Code of the missing well-known
  1379.    attribute.
  1380.  
  1381.    If any of the mandatory well-known attributes are not recognized,
  1382.    then the Error Subcode is set to Unrecognized Well-known Attribute.
  1383.    The Data field contains the unrecognized attribute (type, length and
  1384.    value).
  1385.  
  1386.    If the ORIGIN attribute has an undefined value, then the Error
  1387.    Subcode is set to Invalid Origin Attribute.  The Data field contains
  1388.    the unrecognized attribute (type, length and value).
  1389.  
  1390.    If the NEXT_HOP attribute field is syntactically or semantically
  1391.    incorrect, then the Error Subcode is set to Invalid NEXT_HOP
  1392.    Attribute.
  1393.  
  1394.    The Data field contains the incorrect attribute (type, length and
  1395.  
  1396.  
  1397.  
  1398. Expiration Date January 1994                                   [Page 25]
  1399.  
  1400. INTERNET DRAFT                                                April 1993
  1401.  
  1402.  
  1403.    value).  Syntactic correctness means that the NEXT_HOP attribute
  1404.    represents a valid IP host address.  Semantic correctness applies
  1405.    only to the external BGP links. It means that the interface
  1406.    associated with the IP address, as specified in the NEXT_HOP
  1407.    attribute, shares a common subnet with the receiving BGP speaker and
  1408.    is not the IP address of the receiving BGP speaker.
  1409.  
  1410.    The AS_PATH attribute is checked for syntactic correctness.  If the
  1411.    path is syntactically incorrect, then the Error Subcode is set to
  1412.    Malformed AS_PATH.
  1413.  
  1414.    The AS route specified by the AS_PATH attribute is checked for AS
  1415.    loops.  AS loop detection is done by scanning the full AS route (as
  1416.    specified in the AS_PATH attribute) and checking that each AS occurs
  1417.    at most once.  If a loop is detected, then the Error Subcode is set
  1418.    to AS Routing Loop.  The Data field contains the incorrect attribute
  1419.    (type, length and value).
  1420.  
  1421.    If an optional attribute is recognized, then the value of this
  1422.    attribute is checked.  If an error is detected, the attribute is
  1423.    discarded, and the Error Subcode is set to Optional Attribute Error.
  1424.    The Data field contains the attribute (type, length and value).
  1425.  
  1426.    If any attribute appears more than once in the UPDATE message, then
  1427.    the Error Subcode is set to Malformed Attribute List.
  1428.  
  1429.    Each Network field in the UPDATE message is checked for syntactic
  1430.    validity.  If the Network field is syntactically incorrect, or
  1431.    contains a subnet or a host address, then the Error Subcode is set to
  1432.    Invalid Network Field.
  1433.  
  1434.  
  1435. 6.4 NOTIFICATION message error handling.
  1436.  
  1437.  
  1438.    If a peer sends a NOTIFICATION message, and there is an error in that
  1439.    message, there is unfortunately no means of reporting this error via
  1440.    a subsequent NOTIFICATION message.  Any such error, such as an
  1441.    unrecognized Error Code or Error Subcode, should be noticed, logged
  1442.    locally, and brought to the attention of the administration of the
  1443.    peer.  The means to do this, however, lies outside the scope of this
  1444.    document.
  1445.  
  1446.  
  1447. 6.5 Hold Timer Expired error handling.
  1448.  
  1449.  
  1450.    If a system does not receive successive KEEPALIVE and/or UPDATE
  1451.  
  1452.  
  1453.  
  1454. Expiration Date January 1994                                   [Page 26]
  1455.  
  1456. INTERNET DRAFT                                                April 1993
  1457.  
  1458.  
  1459.    and/or NOTIFICATION messages within the period specified in the Hold
  1460.    Time field of the OPEN message, then the NOTIFICATION message with
  1461.    Hold Timer Expired Error Code must be sent and the BGP connection
  1462.    closed.
  1463.  
  1464.  
  1465. 6.6 Finite State Machine error handling.
  1466.  
  1467.  
  1468.    Any error detected by the BGP Finite State Machine (e.g., receipt of
  1469.    an unexpected event) is indicated by sending the NOTIFICATION message
  1470.    with Error Code Finite State Machine Error.
  1471.  
  1472.  
  1473. 6.7 Cease.
  1474.  
  1475.  
  1476.    In absence of any fatal errors (that are indicated in this section),
  1477.    a BGP peer may choose at any given time to close its BGP connection
  1478.    by sending the NOTIFICATION message with Error Code Cease.  However,
  1479.    the Cease NOTIFICATION message must not be used when a fatal error
  1480.    indicated by this section does exist.
  1481.  
  1482.  
  1483. 6.8 Connection collision detection.
  1484.  
  1485.  
  1486.    If a pair of BGP speakers try simultaneously to establish a TCP
  1487.    connection to each other, then two parallel connections between this
  1488.    pair of speakers might well be formed.  We refer to this situation as
  1489.    connection collision.  Clearly, one of these connections must be
  1490.    closed.
  1491.  
  1492.    Based on the value of the BGP Identifier a convention is established
  1493.    for detecting which BGP connection is to be preserved when a
  1494.    collision does occur. The convention is to compare the BGP
  1495.    Identifiers of the peers involved in the collision and to retain only
  1496.    the connection initiated by the BGP speaker with the higher-valued
  1497.    BGP Identifier.
  1498.  
  1499.    Upon receipt of an OPEN message, the local system must examine all of
  1500.    its connections that are in the OpenConfirm state.  A BGP speaker may
  1501.    also examine connections in an OpenSent state if it knows the BGP
  1502.    Identifier of the neighbor by means outside of the protocol.  If
  1503.    among these connections there is a connection to a remote BGP speaker
  1504.    whose BGP Identifier equals the one in the OPEN message, then the
  1505.    local system performs the following collision resolution procedure:
  1506.  
  1507.  
  1508.  
  1509.  
  1510. Expiration Date January 1994                                   [Page 27]
  1511.  
  1512. INTERNET DRAFT                                                April 1993
  1513.  
  1514.  
  1515.       1. The BGP Identifier of the local system is compared to the BGP
  1516.       Identifier of the remote system (as specified in the OPEN
  1517.       message).
  1518.  
  1519.       2. If the value of the local BGP Identifier is less than the
  1520.       remote one, the local system closes BGP connection that already
  1521.       exists (the one that is already in the OpenConfirm state), and
  1522.       accepts BGP connection initiated by the remote system.
  1523.  
  1524.       3. Otherwise, the local system closes newly created BGP connection
  1525.       (the one associated with the newly received OPEN message), and
  1526.       continues to use the existing one (the one that is already in the
  1527.       OpenConfirm state).
  1528.  
  1529.       Comparing BGP Identifiers is done by treating them as (4-octet
  1530.       long) unsigned integers.
  1531.  
  1532.       A connection collision with an existing BGP connection that is in
  1533.       Established states causes unconditional closing of the newly
  1534.       created connection. Note that a connection collision cannot be
  1535.       detected with connections that are in Idle, or Connect, or Active
  1536.       states.
  1537.  
  1538.       Closing the BGP connection (that results from the collision
  1539.       resolution procedure) is accomplished by sending the NOTIFICATION
  1540.       message with the Error Code Cease.
  1541.  
  1542.  
  1543. 7.  BGP Version Negotiation.
  1544.  
  1545.  
  1546.    BGP speakers may negotiate the version of the protocol by making
  1547.    multiple attempts to open a BGP connection, starting with the highest
  1548.    version number each supports.  If an open attempt fails with an Error
  1549.    Code OPEN Message Error, and an Error Subcode Unsupported Version
  1550.    Number, then the BGP speaker has available the version number it
  1551.    tried, the version number its peer tried, the version number passed
  1552.    by its peer in the NOTIFICATION message, and the version numbers that
  1553.    it supports.  If the two peers do support one or more common
  1554.    versions, then this will allow them to rapidly determine the highest
  1555.    common version. In order to support BGP version negotiation, future
  1556.    versions of BGP must retain the format of the OPEN and NOTIFICATION
  1557.    messages.
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566. Expiration Date January 1994                                   [Page 28]
  1567.  
  1568. INTERNET DRAFT                                                April 1993
  1569.  
  1570.  
  1571. 8.  BGP Finite State machine.
  1572.  
  1573.  
  1574.    This section specifies BGP operation in terms of a Finite State
  1575.    Machine (FSM).  Following is a brief summary and overview of BGP
  1576.    operations by state as determined by this FSM.  A condensed version
  1577.    of the BGP FSM is found in Appendix 1.
  1578.  
  1579.       Initially BGP is in the Idle state.
  1580.  
  1581.       Idle state:
  1582.  
  1583.          In this state BGP refuses all incoming BGP connections.  No
  1584.          resources are allocated to the BGP neighbor.  In response to
  1585.          the Start event (initiated by either system or operator) the
  1586.          local system initializes all BGP resources, starts the
  1587.          ConnectRetry timer, initiates a transport connection to other
  1588.          BGP peer, while listening for connection that may be initiated
  1589.          by the remote BGP peer, and changes its state to Connect.  The
  1590.          exact value of the ConnectRetry timer is a local matter, but
  1591.          should be sufficiently large to allow TCP initialization.
  1592.  
  1593.          If a BGP speaker detects an error, it shuts down the connection
  1594.          and changes its state to Idle. Getting out of the Idle state
  1595.          requires generation of the Start event.  If such an event is
  1596.          generated automatically, then persistent BGP errors may result
  1597.          in persistent flapping of the speaker.  To avoid such a
  1598.          condition it is recommended that Start events should not be
  1599.          generated immediately for a peer that was previously
  1600.          transitioned to Idle due to an error. For a peer that was
  1601.          previously transitioned to Idle due to an error, the time
  1602.          between consecutive generation of Start events, if such events
  1603.          are generated automatically, shall exponentially increase. The
  1604.          value of the initial timer shall be 60 seconds. The time shall
  1605.          be doubled for each consecutive retry.
  1606.  
  1607.          Any other event received in the Idle state is ignored.
  1608.  
  1609.       Connect state:
  1610.  
  1611.          In this state BGP is waiting for the transport protocol
  1612.          connection to be completed.
  1613.  
  1614.          If the transport protocol connection succeeds, the local system
  1615.          clears the ConnectRetry timer, completes initialization, sends
  1616.          an OPEN message to its peer, and changes its state to OpenSent.
  1617.  
  1618.          If the transport protocol connect fails (e.g., retransmission
  1619.  
  1620.  
  1621.  
  1622. Expiration Date January 1994                                   [Page 29]
  1623.  
  1624. INTERNET DRAFT                                                April 1993
  1625.  
  1626.  
  1627.          timeout), the local system restarts the ConnectRetry timer,
  1628.          continues to listen for a connection that may be initiated by
  1629.          the remote BGP peer, and changes its state to Active state.
  1630.  
  1631.          In response to the ConnectRetry timer expired event, the local
  1632.          system restarts the ConnectRetry timer, initiates a transport
  1633.          connection to other BGP peer, continues to listen for a
  1634.          connection that may be initiated by the remote BGP peer, and
  1635.          stays in the Connect state.
  1636.  
  1637.          Start event is ignored in the Active state.
  1638.  
  1639.          In response to any other event (initiated by either system or
  1640.          operator), the local system releases all BGP resources
  1641.          associated with this connection and changes its state to Idle.
  1642.  
  1643.       Active state:
  1644.  
  1645.          In this state BGP is trying to acquire a BGP neighbor by
  1646.          initiating a transport protocol connection.
  1647.  
  1648.          If the transport protocol connection succeeds, the local system
  1649.          clears the ConnectRetry timer, completes initialization, sends
  1650.          an OPEN message to its peer, sets its Hold Timer to a large
  1651.          value, and changes its state to OpenSent.
  1652.  
  1653.          In response to the ConnectRetry timer expired event, the local
  1654.          system restarts the ConnectRetry timer, initiates a transport
  1655.          connection to other BGP peer, continues to listen for a
  1656.          connection that may be initiated by the remote BGP peer, and
  1657.          changes its state to Connect.
  1658.  
  1659.          If the local system detects that a remote peer is trying to
  1660.          establish BGP connection to it, and the IP address of the
  1661.          remote peer is not an expected one, the local system restarts
  1662.          the ConnectRetry timer, rejects the attempted connection,
  1663.          continues to listen for a connection that may be initiated by
  1664.          the remote BGP peer, and stays in the Active state.
  1665.  
  1666.          Start event is ignored in the Active state.
  1667.  
  1668.          In response to any other event (initiated by either system or
  1669.          operator), the local system releases all BGP resources
  1670.          associated with this connection and changes its state to Idle.
  1671.  
  1672.       OpenSent state:
  1673.  
  1674.          In this state BGP waits for an OPEN message from its peer.
  1675.  
  1676.  
  1677.  
  1678. Expiration Date January 1994                                   [Page 30]
  1679.  
  1680. INTERNET DRAFT                                                April 1993
  1681.  
  1682.  
  1683.          When an OPEN message is received, all fields are checked for
  1684.          correctness.  If the BGP message header checking or OPEN
  1685.          message checking detects an error (see Section 6.2), or a
  1686.          connection collision (see Section 6.8) the local system sends a
  1687.          NOTIFICATION message and changes its state to Idle.
  1688.  
  1689.          If there are no errors in the OPEN message, BGP sends a
  1690.          KEEPALIVE message and sets a KeepAlive timer.  The Hold Timer,
  1691.          which was originally set to an arbitrary large value (see
  1692.          above), is replaced with the value indicated in the received
  1693.          OPEN message. If the value of the Autonomous System field is
  1694.          the same as the local Autonomous System number, then the
  1695.          connection is an "internal" connection; otherwise, it is
  1696.          "external".  (This will effect UPDATE processing as described
  1697.          below.)  Finally, the state is changed to OpenConfirm.
  1698.  
  1699.          If a disconnect notification is received from the underlying
  1700.          transport protocol, the local system closes the BGP connection,
  1701.          restarts the ConnectRetry timer, while continue listening for
  1702.          connection that may be initiated by the remote BGP peer, and
  1703.          goes into the Active state.
  1704.  
  1705.          If the Hold Timer expires, the local system sends NOTIFICATION
  1706.          message with error code Hold Timer Expired and changes its
  1707.          state to Idle.
  1708.  
  1709.          In response to the Stop event (initiated by either system or
  1710.          operator) the local system sends NOTIFICATION message with
  1711.          Error Code Cease and changes its state to Idle.
  1712.  
  1713.          Start event is ignored in the OpenSent state.
  1714.  
  1715.          In response to any other event the local system sends
  1716.          NOTIFICATION message with Error Code Finite State Machine Error
  1717.          and changes its state to Idle.
  1718.  
  1719.          Whenever BGP changes its state from OpenSent to Idle, it closes
  1720.          the BGP (and transport-level) connection and releases all
  1721.          resources associated with that connection.
  1722.  
  1723.       OpenConfirm state:
  1724.  
  1725.          In this state BGP waits for a KEEPALIVE or NOTIFICATION
  1726.          message.
  1727.  
  1728.          If the local system receives a KEEPALIVE message, it changes
  1729.          its state to Established.
  1730.  
  1731.  
  1732.  
  1733.  
  1734. Expiration Date January 1994                                   [Page 31]
  1735.  
  1736. INTERNET DRAFT                                                April 1993
  1737.  
  1738.  
  1739.          If the Hold Timer expires before a KEEPALIVE message is
  1740.          received, the local system sends NOTIFICATION message with
  1741.          error code Hold Timer Expired and changes its state to Idle.
  1742.  
  1743.          If the local system receives a NOTIFICATION message, it changes
  1744.          its state to Idle.
  1745.  
  1746.          If the KeepAlive timer expires, the local system sends a
  1747.          KEEPALIVE message and restarts its KeepAlive timer.
  1748.  
  1749.          If a disconnect notification is received from the underlying
  1750.          transport protocol, the local system changes its state to Idle.
  1751.  
  1752.          In response to the Stop event (initiated by either system or
  1753.          operator) the local system sends NOTIFICATION message with
  1754.          Error Code Cease and changes its state to Idle.
  1755.  
  1756.          Start event is ignored in the OpenConfirm state.
  1757.  
  1758.          In response to any other event the local system sends
  1759.          NOTIFICATION message with Error Code Finite State Machine Error
  1760.          and changes its state to Idle.
  1761.  
  1762.          Whenever BGP changes its state from OpenConfirm to Idle, it
  1763.          closes the BGP (and transport-level) connection and releases
  1764.          all resources associated with that connection.
  1765.  
  1766.       Established state:
  1767.  
  1768.          In the Established state BGP can exchange UPDATE, NOTIFICATION,
  1769.          and KEEPALIVE messages with its peer.
  1770.  
  1771.          If the local system receives an UPDATE or KEEPALIVE message, it
  1772.          restarts its Hold Timer.
  1773.  
  1774.          If the local system receives a NOTIFICATION message, it changes
  1775.          its state to Idle.
  1776.  
  1777.          If the local system receives an UPDATE message and the UPDATE
  1778.          message error handling procedure (see Section 6.3) detects an
  1779.          error, the local system sends a NOTIFICATION message and
  1780.          changes its state to Idle.
  1781.  
  1782.          If a disconnect notification is received from the underlying
  1783.          transport protocol, the local system changes its state to Idle.
  1784.  
  1785.          If the Hold Timer expires, the local system sends a
  1786.          NOTIFICATION message with Error Code Hold Timer Expired and
  1787.  
  1788.  
  1789.  
  1790. Expiration Date January 1994                                   [Page 32]
  1791.  
  1792. INTERNET DRAFT                                                April 1993
  1793.  
  1794.  
  1795.          changes its state to Idle.
  1796.  
  1797.          If the KeepAlive timer expires, the local system sends a
  1798.          KEEPALIVE message and restarts its KeepAlive timer.
  1799.  
  1800.          Each time the local system sends a KEEPALIVE or UPDATE message,
  1801.          it restarts its KeepAlive timer.
  1802.  
  1803.          In response to the Stop event (initiated by either system or
  1804.          operator), the local system sends a NOTIFICATION message with
  1805.          Error Code Cease and changes its state to Idle.
  1806.  
  1807.          Start event is ignored in the Established state.
  1808.  
  1809.          In response to any other event, the local system sends
  1810.          NOTIFICATION message with Error Code Finite State Machine Error
  1811.          and changes its state to Idle.
  1812.  
  1813.          Whenever BGP changes its state from Established to Idle, it
  1814.          closes the BGP (and transport-level) connection, releases all
  1815.          resources associated with that connection, and deletes all
  1816.          routes derived from that connection.
  1817.  
  1818.  
  1819. 9.  UPDATE Message Handling
  1820.  
  1821.  
  1822.    An UPDATE message may be received only in the Established state.
  1823.    When an UPDATE message is received, each field is checked for
  1824.    validity as specified in Section 6.3.
  1825.  
  1826.    If an optional non-transitive attribute is unrecognized, it is
  1827.    quietly ignored.  If an optional transitive attribute is
  1828.    unrecognized, the Partial bit (the third high-order bit) in the
  1829.    attribute flags octet is set to 1, and the attribute is retained for
  1830.    propagation to other BGP speakers.
  1831.  
  1832.    If an optional attribute is recognized, and has a valid value, then,
  1833.    depending on the type of the optional attribute, it is processed
  1834.    locally, retained, and updated, if necessary, for possible
  1835.    propagation to other BGP speakers.
  1836.  
  1837.  
  1838.    If the UPDATE message contains a non-empty WITHDRAWN ROUTES field,
  1839.    the previously advertised routes whose  destinations (expressed as IP
  1840.    prefixes) contained in this field shall be removed from the Adj-RIB-
  1841.    In.  This BGP speaker shall run its Decision Process since the
  1842.    previously advertised route is not longer available for use.
  1843.  
  1844.  
  1845.  
  1846. Expiration Date January 1994                                   [Page 33]
  1847.  
  1848. INTERNET DRAFT                                                April 1993
  1849.  
  1850.  
  1851.    If the UPDATE message contains a feasible route, it shall be placed
  1852.    in the appropriate Adj-RIB-In, and the following additional actions
  1853.    shall be taken:
  1854.  
  1855.    i) If its Network Layer Reachability Information (NLRI) is identical
  1856.    to the one of a route currently stored in the Adj-RIB-In, then the
  1857.    new route shall replace the older route in the Adj-RIB-In, thus
  1858.    implicitly withdrawing the older route from service. The BGP speaker
  1859.    shall run its Decision Process since the older route is no longer
  1860.    available for use.
  1861.  
  1862.    ii) If the new route is an overlapping route that is included (see
  1863.    9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP
  1864.    speaker shall run its Decision Process since the more specific route
  1865.    has implicitly made a portion of the less specific route unavailable
  1866.    for use.
  1867.  
  1868.    iii) If the new route has identical path attributes to an earlier
  1869.    route contained in the Adj-RIB-In, and is more specific (see 9.1.4)
  1870.    than the earlier route, no further actions are necessary.
  1871.  
  1872.    iv) If the new route has NLRI that is not present in any of the
  1873.    routes currently stored in the Adj-RIB-In, then the new route shall
  1874.    be placed in the Adj-RIB-In. The BGP speaker shall run its Decision
  1875.    Process.
  1876.  
  1877.    v) If the new route is an overlapping route that is less specific
  1878.    (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the
  1879.    BGP speaker shall run its Decision Process on the set of destinations
  1880.    described only by the less specific route.
  1881.  
  1882.  
  1883. 9.1 Decision Process
  1884.  
  1885.  
  1886.    The Decision Process selects routes for subsequent advertisement by
  1887.    applying the policies in the local Policy Information Base (PIB) to
  1888.    the routes stored in its Adj-RIB-In. The output of the Decision
  1889.    Process is the set of routes that will be advertised to adjacent BGP
  1890.    speakers; the selected routes will be stored in the local speaker's
  1891.    Adj-RIB-Out.
  1892.  
  1893.    The selection process is formalized by defining a function that takes
  1894.    the attribute of a given route as an argument and returns a non-
  1895.    negative integer denoting the degree of preference for the route.
  1896.    The function that calculates the degree of preference for a given
  1897.    route shall not use as its inputs any of the following: the existence
  1898.    of other routes, the non-existence of other routes, or the path
  1899.  
  1900.  
  1901.  
  1902. Expiration Date January 1994                                   [Page 34]
  1903.  
  1904. INTERNET DRAFT                                                April 1993
  1905.  
  1906.  
  1907.    attributes of other routes. Route selection then consists of
  1908.    individual application of the degree of preference function to each
  1909.    feasible route, followed by the choice of the one with the highest
  1910.    degree of preference.
  1911.  
  1912.    The Decision Process operates on routes contained in each Adj-RIB-In,
  1913.    and is responsible for:
  1914.  
  1915.       - selection of routes to be advertised to BGP speakers located in
  1916.       the local speaker's autonomous system
  1917.  
  1918.       - selection of routes to be advertised to BGP speakers located in
  1919.       adjacent autonomous systems
  1920.  
  1921.       - route aggregation and route information reduction
  1922.  
  1923.    The Decision Process takes place in three distinct phases, each
  1924.    triggered by a different event:
  1925.  
  1926.       a) Phase 1 is responsible for calculating the degree of preference
  1927.       for each route received from a BGP speaker located in an adjacent
  1928.       autonomous system, and for advertising to the other BGP speakers
  1929.       in the local autonomous system the routes that have the highest
  1930.       degree of preference for each distinct destination.
  1931.  
  1932.       b) Phase 2 is invoked on completion of phase 1. It is responsible
  1933.       for choosing the best route out of all those available for each
  1934.       distinct destination, and for installing each chosen route into
  1935.       the appropriate Loc-RIB.
  1936.  
  1937.       c) Phase 3 is invoked after the Loc-RIB has been modified. It is
  1938.       responsible for disseminating routes in the Loc-RIB to each
  1939.       adjacent BGP speaker located in an adjacent autonomous system,
  1940.       according to the policies contained in the PIB. Route aggregation
  1941.       and information reduction can optionally be performed within this
  1942.       phase.
  1943.  
  1944.  
  1945. 9.1.1 Phase 1: Calculation of Degree of Preference
  1946.  
  1947.  
  1948.    The Phase 1 decision function shall be invoked whenever the local BGP
  1949.    speaker receives an UPDATE message from a neighboring BGP speaker
  1950.    located in an adjacent autonomous system that advertises a new route,
  1951.    a replacement route, or a withdrawn route.
  1952.  
  1953.    The Phase 1 decision function is a separate process which completes
  1954.    when it has no further work to do.
  1955.  
  1956.  
  1957.  
  1958. Expiration Date January 1994                                   [Page 35]
  1959.  
  1960. INTERNET DRAFT                                                April 1993
  1961.  
  1962.  
  1963.    The Phase 1 decision function shall lock an Adj-RIB-In prior to
  1964.    operating on any route contained within it, and shall unlock it after
  1965.    operating on all new or unfeasible routes contained within it.
  1966.  
  1967.    For each newly received or replacement feasible route, the local BGP
  1968.    speaker shall determine a degree of preference. If the route is
  1969.    learned from a BGP speaker in the local autonomous system, either the
  1970.    value of the LOCAL_PREF attribute shall be taken as the degree of
  1971.    preference, or the local system shall compute the degree of
  1972.    preference of the route based on preconfigured policy information. If
  1973.    the route is learned from a BGP speaker in an adjacent autonomous
  1974.    system, then the degree of preference shall be computed based on
  1975.    preconfigured policy information.  The exact nature of this policy
  1976.    information and the computation involved is a local matter.  The
  1977.    local speaker shall then run the internal update process of 9.2.1 to
  1978.    select and advertise the most preferable route.
  1979.  
  1980.  
  1981. 9.1.2 Phase 2: Route Selection
  1982.  
  1983.  
  1984.    The Phase 2 decision function shall be invoked on completion of Phase
  1985.    1.  The Phase 2 function is a separate process which completes when
  1986.    it has no further work to do. The Phase 2 process shall consider all
  1987.    routes that are present in the Adj-RIBs-In, including those received
  1988.    from BGP speakers located in its own autonomous system and those
  1989.    received from BGP speakers located in adjacent autonomous systems.
  1990.  
  1991.    The Phase 2 decision function shall be blocked from running while the
  1992.    Phase 3 decision function is in process. The Phase 2 function shall
  1993.    lock all Adj-RIBs-In prior to commencing its function, and shall
  1994.    unlock them on completion.
  1995.  
  1996.    For each set of destinations for which a feasible route exists in the
  1997.    Adj-RIBs-In, the local BGP speaker shall identify the route that has:
  1998.  
  1999.       a) the highest degree of preference of any route to the same set
  2000.       of destinations, or
  2001.  
  2002.       b) is the only route to that destination, or
  2003.  
  2004.       c) is selected as a result of the Phase 2 tie breaking rules
  2005.       specified in 9.1.2.1.
  2006.  
  2007.  
  2008.    An alternative procedure for selecting a route may be realized if a
  2009.    BGP speaker can ascertain whether a particular route the speaker
  2010.    wants to select is also present in the interior routing protocol
  2011.  
  2012.  
  2013.  
  2014. Expiration Date January 1994                                   [Page 36]
  2015.  
  2016. INTERNET DRAFT                                                April 1993
  2017.  
  2018.  
  2019.    (IGP) of the autonomous system the speaker belongs to, and that the
  2020.    BGP speaker that injected the route into the IGP has this route
  2021.    installed in its Loc-RIB. A BGP speaker may select a route, provided
  2022.    that the following conditions are satisfied:
  2023.  
  2024.       a) the NLRI of the route is present in the IGP of the autonomous
  2025.       system the speaker belongs to
  2026.  
  2027.       b) the BGP speaker that injected the NLRI into the IGP has the
  2028.       route in its Loc-RIB
  2029.  
  2030.       c) the BGP speaker that injected the NLRI into the IGP  will be
  2031.       used as an exit point by the IGP.
  2032.  
  2033.    The exact procedures for verifying the above conditions are specific
  2034.    to a particular IGP and are outside the scope of this document.
  2035.  
  2036.    The local speaker shall then install that route in the Loc-RIB,
  2037.    replacing any route to the same destination that is currently being
  2038.    held in the Loc-RIB.
  2039.  
  2040.    Unfeasible routes shall be removed from the Loc-RIB, and
  2041.    corresponding unfeasible routes shall then be removed from the Adj-
  2042.    RIBs-In.
  2043.  
  2044.  
  2045. 9.1.2.1 Breaking Ties (Phase 2)
  2046.  
  2047.  
  2048.    In its Adj-RIBs-In a BGP speaker may have several routes to the same
  2049.    destination that have the same degree of preference. The local
  2050.    speaker can select only one of these routes for inclusion in the
  2051.    associated Loc-RIB. The local speaker considers all equally
  2052.    preferable routes, both those received from BGP speakers located in
  2053.    adjacent autonomous systems, and those received from other BGP
  2054.    speakers located in the local speaker's autonomous system.
  2055.  
  2056.    Ties shall be broken according to the following rules:
  2057.  
  2058.       a) If the candidate routes have identical path attributes or
  2059.       differ only in the NEXT_HOP attribute, select the route that was
  2060.       advertised by the BGP speaker in an adjacent autonomous system
  2061.       whose BGP Identifier has the lowest value. If none of the
  2062.       candidate routes were received from a BGP speaker located in an
  2063.       adjacent autonomous system, select the route that was advertised
  2064.       by the BGP speaker in the local autonomous system whose BGP
  2065.       Identifier has the lowest value.
  2066.  
  2067.  
  2068.  
  2069.  
  2070. Expiration Date January 1994                                   [Page 37]
  2071.  
  2072. INTERNET DRAFT                                                April 1993
  2073.  
  2074.  
  2075.       b) If the candidate routes differ only in their NEXT_HOP and
  2076.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2077.       take into account MULTI_EXIT_DISC, select the route that has the
  2078.       lowest value of the MULTI_EXIT_DISC attribute.
  2079.  
  2080.       If the local system is configured to ignore MULTI_EXIT_DISC,
  2081.       select the route advertised by the BGP speaker in an adjacent
  2082.       autonomous system whose BGP Identifier has the lowest value.  If
  2083.       none of the candidate routes were received from a BGP speaker
  2084.       located in an adjacent autonomous system, select the route that
  2085.       was advertised by the BGP speaker in the local autonomous system
  2086.       whose BGP Identifier has the lowest value.
  2087.  
  2088.       c) If the candidate routes differ in any path attributes other
  2089.       than NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes
  2090.       were advertised by the BGP speakers within the local autonomous
  2091.       system, select the route that was advertised by the BGP speaker
  2092.       whose BGP identifier has the lowest value.
  2093.  
  2094.       If the candidate routes differ in any path attributes other than
  2095.       NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes were
  2096.       advertised by the BGP speakers in adjacent autonomous systems,
  2097.       select the route that was advertised by the BGP speaker whose BGP
  2098.       identifier has the lowest value.
  2099.  
  2100.       If the candidate routes differ in any path attributes other than
  2101.       NEXT_HOP and MULTI_EXIT_DISC, and some of the candidate routes
  2102.       were advertised by the BGP speakers in adjacent autonomous system,
  2103.       while others were advertised by the BGP speakers within the local
  2104.       autonomous system, the local system shall determine the BGP
  2105.       speaker within the local autonomous system whose BGP identifier
  2106.       has the lowest value and is advertising a candidate route
  2107.       (including itself).
  2108.  
  2109.       If this speaker is the local system, then select the route that
  2110.       was advertised by the BGP speaker in an adjacent autonomous system
  2111.       whose BGP identifier has the lowest value among all other BGP
  2112.       speakers in adjacent autonomous systems.
  2113.  
  2114.       Otherwise (if the BGP identifier of the local system is not the
  2115.       lowest among all BGP speakers within the local autonomous system
  2116.       advertising a candidate route), select the route that was
  2117.       advertised by the BGP speaker within the local autonomous system
  2118.       whose BGP identifier has the lowest value.
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126. Expiration Date January 1994                                   [Page 38]
  2127.  
  2128. INTERNET DRAFT                                                April 1993
  2129.  
  2130.  
  2131. 9.1.3   Phase 3: Route Dissemination
  2132.  
  2133.  
  2134.    The Phase 3 decision function shall be invoked on completion of Phase
  2135.    2, or when any of the following events occur:
  2136.  
  2137.       a) when routes in a Loc-RIB to local destinations have changed
  2138.  
  2139.       b) when locally generated routes learned by means outside of BGP
  2140.       have changed
  2141.  
  2142.       c) when a new BGP speaker - BGP speaker connection has been
  2143.       established
  2144.  
  2145.    The Phase 3 function is a separate process which completes when it
  2146.    has no further work to do. The Phase 3 Routing Decision function
  2147.    shall be blocked from running while the Phase 2 decision function is
  2148.    in process.
  2149.  
  2150.    All routes in the Loc-RIB shall be processed into a corresponding
  2151.    entry in the associated Adj-RIBs-Out. Route aggregation and
  2152.    information reduction techniques (see 9.2.4.1) may optionally be
  2153.    applied.
  2154.  
  2155.  
  2156.    For the benefit of future support of inter-AS multicast capabilities,
  2157.    a BGP speaker that participates in the inter-AS multicast shall
  2158.    advertise a route it receives from one of its external peers and
  2159.    installs in its Loc-RIB back to the peer from which the route was
  2160.    received. For a BGP speaker that does not participate in the inter-AS
  2161.    multicast such an advertisement is optional. When doing such an
  2162.    advertisement, the NEXT_HOP attribute should be set to the address of
  2163.    the peer. An implementation may also optimize such an advertisement
  2164.    by truncating information in the AS_PATH attribute to include only
  2165.    its own AS number and that of the peer that advertised the route
  2166.    (such truncation requires the ORIGIN attribute to be set to
  2167.    INCOMPLETE).  In addition an implementation is not required to pass
  2168.    optional or discretionary path attributes with such an advertisement.
  2169.  
  2170.    When the updating of the Adj-RIBs-Out and the Forwarding Information
  2171.    Base (FIB) is complete, the local BGP speaker shall run the external
  2172.    update process of 9.2.2.
  2173.  
  2174.  
  2175. 9.1.4 Overlapping Routes
  2176.  
  2177.  
  2178.    A BGP speaker may transmit routes with overlapping Network Layer
  2179.  
  2180.  
  2181.  
  2182. Expiration Date January 1994                                   [Page 39]
  2183.  
  2184. INTERNET DRAFT                                                April 1993
  2185.  
  2186.  
  2187.    Reachability Information (NLRI) to another BGP speaker. NLRI overlap
  2188.    occurs when a set of destinations are identified in non-matching
  2189.    multiple routes. Since BGP encodes NLRI using IP prefixes, overlap
  2190.    will always exhibit subset relationships.  A route describing a
  2191.    smaller set of destinations (a longer prefix) is said to be more
  2192.    specific than a route describing a larger set of destinations (a
  2193.    shorted prefix); similarly, a route describing a larger set of
  2194.    destinations (a shorter prefix) is said to be less specific than a
  2195.    route describing a smaller set of destinations (a longer prefix).
  2196.  
  2197.    The precedence relationship effectively decomposes less specific
  2198.    routes into two parts:
  2199.  
  2200.       -  a set of destinations described only by the less specific
  2201.       route, and
  2202.  
  2203.       -  a set of destinations described by the overlap of the less
  2204.       specific and the more specific routes
  2205.  
  2206.  
  2207.    When overlapping routes are present in the same Adj-RIB-In, the more
  2208.    specific route shall take precedence, in order from more specific to
  2209.    least specific.
  2210.  
  2211.    The set of destinations described by the overlap represents a portion
  2212.    of the less specific route that is feasible, but is not currently in
  2213.    use.  If a more specific route is later withdrawn, the set of
  2214.    destinations described by the overlap will still be reachable using
  2215.    the less specific route.
  2216.  
  2217.    If a BGP speaker receives overlapping routes, the Decision Process
  2218.    shall take into account the semantics of the overlapping routes. In
  2219.    particular, if a BGP speaker accepts the less specific route while
  2220.    rejecting the more specific route from the same neighbor, then the
  2221.    destinations represented by the overlap may not forward along the ASs
  2222.    listed in the AS_PATH attribute of that route. Therefore, a BGP
  2223.    speaker has the following choices:
  2224.  
  2225.       a)   Install both the less and the more specific routes
  2226.  
  2227.       b)   Install the more specific route only
  2228.  
  2229.       c)   Install the non-overlapping part of the less specific
  2230.                  route only (that implies de-aggregation)
  2231.  
  2232.       d)   Aggregate the two routes and install the aggregated route
  2233.  
  2234.       e)   Install the less specific route only
  2235.  
  2236.  
  2237.  
  2238. Expiration Date January 1994                                   [Page 40]
  2239.  
  2240. INTERNET DRAFT                                                April 1993
  2241.  
  2242.  
  2243.       f)   Install neither route
  2244.  
  2245.    If a BGP speaker chooses e), then it should add ATOMIC_AGGREGATE
  2246.    attribute to the route. A route that carries ATOMIC_AGGREGATE
  2247.    attribute can not be de-aggregated. That is, the NLRI of this route
  2248.    can not be made more specific.  Forwarding along such a route does
  2249.    not guarantee that IP packets will actually traverse only ASs listed
  2250.    in the AS_PATH attribute of the route.  If a BGP speaker chooses a),
  2251.    it must not advertise the more general route without the more
  2252.    specific route.
  2253.  
  2254.  
  2255. 9.2 Update-Send Process
  2256.  
  2257.  
  2258.    The Update-Send process is responsible for advertising UPDATE
  2259.    messages to adjacent BGP speakers. For example, it distributes the
  2260.    routes chosen by the Decision Process to other BGP speakers which may
  2261.    be located in either the same autonomous system or an adjacent
  2262.    autonomous system.  Rules for information exchange between BGP
  2263.    speakers located in different autonomous systems are given in 9.2.2;
  2264.    rules for information exchange between BGP speakers located in the
  2265.    same autonomous system are given in 9.2.1.
  2266.  
  2267.    Distribution of routing information between a set of BGP speakers,
  2268.    all of which are located in the same autonomous system, is referred
  2269.    to as internal distribution.
  2270.  
  2271.  
  2272. 9.2.1 Internal Updates
  2273.  
  2274.  
  2275.    The Internal update process is concerned with the distribution of
  2276.    routing information to BGP speakers located in the local speaker's
  2277.    autonomous system.
  2278.  
  2279.    When a BGP speaker receives an UPDATE message from another BGP
  2280.    speaker located in its own autonomous system, the receiving BGP
  2281.    speaker shall not re-distribute the routing information contained in
  2282.    that UPDATE message to other BGP speakers located in its own
  2283.    autonomous system.
  2284.  
  2285.    When a BGP speaker receives a new route from a BGP speaker in an
  2286.    adjacent autonomous system, it shall advertise that route to all
  2287.    other BGP speakers in its autonomous system by means of an UPDATE
  2288.    message if any of the following conditions occur:
  2289.  
  2290.       1) the degree of preference assigned to the newly received route
  2291.  
  2292.  
  2293.  
  2294. Expiration Date January 1994                                   [Page 41]
  2295.  
  2296. INTERNET DRAFT                                                April 1993
  2297.  
  2298.  
  2299.       by the local BGP speaker is higher than the degree of preference
  2300.       that the local speaker has assigned to other routes that have been
  2301.       received from BGP speakers in adjacent autonomous systems, or
  2302.  
  2303.       2) there are no other routes that have been received from BGP
  2304.       speakers in adjacent autonomous systems, or
  2305.  
  2306.       3) the newly received route is selected as a result of breaking a
  2307.       tie between several routes which have the highest degree of
  2308.       preference, and the same destination.
  2309.  
  2310.    When a BGP speaker receives an UPDATE message with a non-empty
  2311.    WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all
  2312.    routes whose destinations was carried in this field (as IP prefixes).
  2313.    The speaker shall take the following additional steps:
  2314.  
  2315.       1) if the corresponding feasible route had not been previously
  2316.       advertised, then no further action is necessary
  2317.  
  2318.       2) if the corresponding feasible route had been previously
  2319.       advertised, then:
  2320.  
  2321.          i) if a new route is selected for advertisement that has the
  2322.          same Network Layer Reachability Information as the unfeasible
  2323.          routes, then the local BGP speaker shall advertise the
  2324.          replacement route
  2325.  
  2326.          ii) if a replacement route is not available for advertisement,
  2327.          then the BGP speaker shall include the destinations  of the
  2328.          unfeasible route (in form of IP prefixes) in the WITHDRAWN
  2329.          ROUTES field of an UPDATE message, and shall send this message
  2330.          to each neighbor BGP speaker to whom it had previously
  2331.          advertised the corresponding feasible route.
  2332.  
  2333.  
  2334.    All feasible routes which are advertised shall be placed in the
  2335.    appropriate Adj-RIBs-Out, and all unfeasible routes which are
  2336.    advertised shall be removed from the Adj-RIBs-Out.
  2337.  
  2338.  
  2339. 9.2.1.1 Breaking Ties (Internal Updates)
  2340.  
  2341.  
  2342.    If a local BGP speaker has connections to several BGP speakers in
  2343.    adjacent autonomous systems, there will be multiple Adj-RIBs-In
  2344.    associated with these neighbors. These Adj-RIBs-In might contain
  2345.    several equally preferable routes to the same destination, all of
  2346.    which were advertised by BGP speakers located in adjacent autonomous
  2347.  
  2348.  
  2349.  
  2350. Expiration Date January 1994                                   [Page 42]
  2351.  
  2352. INTERNET DRAFT                                                April 1993
  2353.  
  2354.  
  2355.    systems. The local BGP speaker shall select one of these routes
  2356.    according to the following rules:
  2357.  
  2358.       a) If the candidate route differ only in their NEXT_HOP and
  2359.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2360.       take into account MULTI_EXIT_DISC attribute, select the routes
  2361.       that has the lowest value of the MULTI_EXIT_DISC attribute.
  2362.  
  2363.       b) In all other cases, select the route that was advertised by the
  2364.       BGP speaker whose BGP Identifier has the lowest value.
  2365.  
  2366.  
  2367.  
  2368. 9.2.2 External Updates
  2369.  
  2370.  
  2371.    The external update process is concerned with the distribution of
  2372.    routing information to BGP speakers located in adjacent autonomous
  2373.    systems. As part of Phase 3 route selection process, the BGP speaker
  2374.    has updated its Adj-RIBs-Out and its Forwarding Table. All newly
  2375.    installed routes and all newly unfeasible routes for which there is
  2376.    no replacement route shall be advertised to BGP speakers located in
  2377.    adjacent autonomous systems by means of UPDATE message.
  2378.  
  2379.    Any routes in the Loc-RIB marked as unfeasible shall be removed.
  2380.    Changes to the reachable destinations within its own autonomous
  2381.    system shall also be advertised in an UPDATE message.
  2382.  
  2383.  
  2384. 9.2.3 Controlling Routing Traffic Overhead
  2385.  
  2386.  
  2387.    The BGP protocol constrains the amount of routing traffic (that is,
  2388.    UPDATE messages) in order to limit both the link bandwidth needed to
  2389.    advertise UPDATE messages and the processing power needed by the
  2390.    Decision Process to digest the information contained in the UPDATE
  2391.    messages.
  2392.  
  2393.  
  2394. 9.2.3.1 Frequency of Route Advertisement
  2395.  
  2396.  
  2397.    The parameter MinRouteAdvertisementInterval determines the minimum
  2398.    amount of time that must elapse between advertisement of routes to a
  2399.    particular destination from a single BGP speaker. This rate limiting
  2400.    procedure applies on a per-destination basis, although the value of
  2401.    MinRouteAdvertisementInterval is set on a per BGP peer basis.
  2402.  
  2403.  
  2404.  
  2405.  
  2406. Expiration Date January 1994                                   [Page 43]
  2407.  
  2408. INTERNET DRAFT                                                April 1993
  2409.  
  2410.  
  2411.    Two UPDATE messages sent from a single BGP speaker that advertise
  2412.    feasible routes to some common set of destinations received from BGP
  2413.    speakers in adjacent autonomous systems must be separated by at least
  2414.    MinRouteAdvertisementInterval. Clearly, this can only be achieved
  2415.    precisely by keeping a separate timer for each common set of
  2416.    destinations. This would be unwarranted overhead. Any technique which
  2417.    ensures that the interval between two UPDATE messages sent from a
  2418.    single BGP speaker that advertise feasible routes to some common set
  2419.    of destinations received from BGP speakers in adjacent autonomous
  2420.    systems will be at least MinRouteAdvertisementInterval, and will also
  2421.    ensure a constant upper bound on the interval is acceptable.
  2422.  
  2423.    Since fast convergence is needed within an autonomous system, this
  2424.    procedure does not apply for routes receives from other BGP speakers
  2425.    in the same autonomous system. To avoid long-lived black holes, the
  2426.    procedure does not apply to the explicit withdrawal of unfeasible
  2427.    routes (that is, routes whose destinations (expressed as IP prefixes)
  2428.    are listed in the WITHDRAWN ROUTES field of an UPDATE message).
  2429.  
  2430.    This procedure does not limit the rate of route selection, but only
  2431.    the rate of route advertisement. If new routes are selected multiple
  2432.    times while awaiting the expiration of MinRouteAdvertisementInterval,
  2433.    the last route selected shall be advertised at the end of
  2434.    MinRouteAdvertisementInterval.
  2435.  
  2436.  
  2437. 9.2.3.2 Frequency of Route Origination
  2438.  
  2439.  
  2440.    The parameter MinASOriginationInterval determines the minimum amount
  2441.    of time that must elapse between successive advertisements of UPDATE
  2442.    messages that report changes within the advertising BGP speaker's own
  2443.    autonomous systems.
  2444.  
  2445.  
  2446. 9.2.3.3 Jitter
  2447.  
  2448.  
  2449.    To minimize the likelihood that the distribution of BGP messages by a
  2450.    given BGP speaker will contain peaks, jitter should be applied to the
  2451.    timers associated with MinASOriginationInterval, Keepalive, and
  2452.    MinRouteAdvertisementInterval. A given BGP speaker shall apply the
  2453.    same jitter to each of these quantities regardless of the
  2454.    destinations to which the updates are being sent; that is, jitter
  2455.    will not be applied on a "per peer" basis.
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462. Expiration Date January 1994                                   [Page 44]
  2463.  
  2464. INTERNET DRAFT                                                April 1993
  2465.  
  2466.  
  2467. 9.2.4 Efficient Organization of Routing Information
  2468.  
  2469.  
  2470.    Having selected the routing information which it will advertise, a
  2471.    BGP speaker may avail itself of several methods to organize this
  2472.    information in an efficient manner.
  2473.  
  2474.  
  2475. 9.2.4.1 Information Reduction
  2476.  
  2477.  
  2478.    Information reduction may imply a reduction in granularity of policy
  2479.    control - after information is collapsed, the same policies will
  2480.    apply to all destinations and paths in the equivalence class.
  2481.  
  2482.    The Decision Process may optionally reduce the amount of information
  2483.    that it will place in the Adj-RIBs-Out by any of the following
  2484.    methods:
  2485.  
  2486.       a)   Network Layer Reachability Information (NLRI):
  2487.  
  2488.       Destination IP addresses can be represented as IP address
  2489.       prefixes.  In cases where there is a correspondence between the
  2490.       address structure and the systems under control of an autonomous
  2491.       system administrator, it will be possible to reduce the size of
  2492.       the NLRI carried in the UPDATE messages.
  2493.  
  2494.       b)   AS_PATHs:
  2495.  
  2496.       AS path information can be represented as ordered AS_SEQUENCEs or
  2497.       unordered AS_SETs. AS_SETs are used in the route aggregation
  2498.       algorithm described in 9.2.4.2. They reduce the size of the
  2499.       AS_PATH information by listing each AS number only once,
  2500.       regardless of how many times it may have appeared in multiple
  2501.       AS_PATHs that were aggregated.
  2502.  
  2503.       An AS_SET implies that the destinations listed in the NLRI can be
  2504.       reached through paths that traverse at least some of the
  2505.       constituent autonomous systems. AS_SETs provide sufficient
  2506.       information to avoid routing information looping; however their
  2507.       use may prune potentially feasible paths, since such paths are no
  2508.       longer listed individually as in the form of AS_SEQUENCEs.  In
  2509.       practice this is not likely to be a problem, since once an IP
  2510.       packet arrives at the edge of a group of autonomous systems, the
  2511.       BGP speaker at that point is likely to have more detailed path
  2512.       information and can distinguish individual paths to destinations.
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518. Expiration Date January 1994                                   [Page 45]
  2519.  
  2520. INTERNET DRAFT                                                April 1993
  2521.  
  2522.  
  2523. 9.2.4.2 Aggregating Routing Information
  2524.  
  2525.  
  2526.    Aggregation is the process of combining the characteristics of
  2527.    several different routes in such a way that a single route can be
  2528.    advertised.  Aggregation can occur as part of the decision  process
  2529.    to reduce the amount of routing information that will be placed in
  2530.    the Adj-RIBs-Out.
  2531.  
  2532.    Aggregation reduces the amount of information that a BGP speaker must
  2533.    store and exchange with other BGP speakers. Routes can be aggregated
  2534.    by applying the following procedure separately to path attributes of
  2535.    like type and to the Network Layer Reachability Information.
  2536.  
  2537.    Routes that have the following attributes shall not be aggregated
  2538.    unless the corresponding attributes of each route are identical:
  2539.    MULTI_EXIT_DISC, NEXT_HOP.
  2540.  
  2541.    Path attributes that have different type codes can not be aggregated
  2542.    together. Path of the same type code may be aggregated, according to
  2543.    the following rules:
  2544.  
  2545.       ORIGIN attribute: If at least one route among routes that are
  2546.       aggregated has ORIGIN with the value INCOMPLETE, then the
  2547.       aggregated route must have the ORIGIN attribute with the value
  2548.       INCOMPLETE. Otherwise, if at least one route among routes that are
  2549.       aggregated has ORIGIN with the value EGP, then the aggregated
  2550.       route must have the origin attribute with the value EGP. In all
  2551.       other case the value of the ORIGIN attribute of the aggregated
  2552.       route is INTERNAL.
  2553.  
  2554.       AS_PATH attribute: If routes to be aggregated have identical
  2555.       AS_PATH attributes, then the aggregated route has the same AS_PATH
  2556.       attribute as each individual route.
  2557.  
  2558.       For the purpose of aggregating AS_PATH attributes we model each AS
  2559.       within the AS_PATH attribute as a tuple <type, value>, where
  2560.       "type" identifies a type of the path segment the AS belongs to
  2561.       (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number.  If the
  2562.       routes to be aggregated have different AS_PATH attributes, then
  2563.       the aggregated AS_PATH attribute shall satisfy all of the
  2564.       following conditions:
  2565.  
  2566.          - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH
  2567.          shall appear in all of the AS_PATH in the initial set of routes
  2568.          to be aggregated.
  2569.  
  2570.          - all tuples of the type AS_SET in the aggregated AS_PATH shall
  2571.  
  2572.  
  2573.  
  2574. Expiration Date January 1994                                   [Page 46]
  2575.  
  2576. INTERNET DRAFT                                                April 1993
  2577.  
  2578.  
  2579.          appear in at least one of the AS_PATH in the initial set (they
  2580.          may appear as either AS_SET or AS_SEQUENCE types).
  2581.  
  2582.          - for any tuple X of the type AS_SEQUENCE in the aggregated
  2583.          AS_PATH which precedes tuple Y in the aggregated AS_PATH, X
  2584.          precedes Y in each AS_PATH in the initial set which contains Y,
  2585.          regardless of the type of Y.
  2586.  
  2587.          - No tuple with the same value shall appear more than once in
  2588.          the aggregated AS_PATH, regardless of the tuple's type.
  2589.  
  2590.       An implementation may choose any algorithm which conforms to these
  2591.       rules.  At a minimum a conformant implementation shall be able to
  2592.       perform the following algorithm that meets all of the above
  2593.       conditions:
  2594.  
  2595.          - determine the longest leading sequence of tuples (as defined
  2596.          above) common to all the AS_PATH attributes of the routes to be
  2597.          aggregated. Make this sequence the leading sequence of the
  2598.          aggregated AS_PATH attribute.
  2599.  
  2600.          - set the type of the rest of the tuples from the AS_PATH
  2601.          attributes of the routes to be aggregated to AS_SET, and append
  2602.          them to the aggregated AS_PATH attribute.
  2603.  
  2604.          - if the aggregated AS_PATH has more than one tuple with the
  2605.          same value (regardless of tuple's type), eliminate all, but one
  2606.          such tuple by deleting tuples of the type AS_SET from the
  2607.          aggregated AS_PATH attribute.
  2608.  
  2609.       Appendix 6, section 6.8 presents another algorithm that satisfies
  2610.       the conditions and  allows for more complex policy configurations.
  2611.  
  2612.       ATOMIC_AGGREGATE: If at least one of the routes to be aggregated
  2613.       has ATOMIC_AGGREGATE path attribute, then the aggregated route
  2614.       shall have this attribute as well.
  2615.  
  2616.       AGGREGATOR: All AGGREGATOR attributes of all routes to be
  2617.       aggregated should be ignored.
  2618.  
  2619.  
  2620. 9.3.6   Route Selection Criteria
  2621.  
  2622.  
  2623.    Generally speaking, the rules for comparing routes among several
  2624.    alternatives are outside the scope of this document.  There are two
  2625.    exceptions:
  2626.  
  2627.  
  2628.  
  2629.  
  2630. Expiration Date January 1994                                   [Page 47]
  2631.  
  2632. INTERNET DRAFT                                                April 1993
  2633.  
  2634.  
  2635.       - If the local AS appears in the AS path of the new route being
  2636.       considered, then that new route cannot be viewed as better than
  2637.       any other route.  If such a route were ever used, a routing loop
  2638.       would result.
  2639.  
  2640.       - In order to achieve successful distributed operation, only
  2641.       routes with a likelihood of stability can be chosen.  Thus, an AS
  2642.       must avoid using unstable routes, and it must not make rapid
  2643.       spontaneous changes to its choice of route.  Quantifying the terms
  2644.       "unstable" and "rapid" in the previous sentence will require
  2645.       experience, but the principle is clear.
  2646.  
  2647.  
  2648. Appendix 1.  BGP FSM State Transitions and Actions.
  2649.  
  2650.  
  2651.    This Appendix discusses the transitions between states in the BGP FSM
  2652.    in response to BGP events.  The following is the list of these states
  2653.    and events.
  2654.  
  2655.        BGP States:
  2656.  
  2657.                 1 - Idle
  2658.                 2 - Connect
  2659.                 3 - Active
  2660.                 4 - OpenSent
  2661.                 5 - OpenConfirm
  2662.                 6 - Established
  2663.  
  2664.  
  2665.        BGP Events:
  2666.  
  2667.                 1 - BGP Start
  2668.                 2 - BGP Stop
  2669.                 3 - BGP Transport connection open
  2670.                 4 - BGP Transport connection closed
  2671.                 5 - BGP Transport connection open failed
  2672.                 6 - BGP Transport fatal error
  2673.                 7 - ConnectRetry timer expired
  2674.                 8 - Hold Timer expired
  2675.                 9 - KeepAlive timer expired
  2676.                10 - Receive OPEN message
  2677.                11 - Receive KEEPALIVE message
  2678.                12 - Receive UPDATE messages
  2679.                13 - Receive NOTIFICATION message
  2680.  
  2681.    The following table describes the state transitions of the BGP FSM
  2682.    and the actions triggered by these transitions.
  2683.  
  2684.  
  2685.  
  2686. Expiration Date January 1994                                   [Page 48]
  2687.  
  2688. INTERNET DRAFT                                                April 1993
  2689.  
  2690.  
  2691.        Event                Actions               Message Sent   Next State
  2692.        --------------------------------------------------------------------
  2693.        Idle (1)
  2694.         1            Initialize resources            none             2
  2695.                      Start ConnectRetry timer
  2696.                      Initiate a transport connection
  2697.         others               none                    none             1
  2698.  
  2699.        Connect(2)
  2700.         1                    none                    none             2
  2701.         3            Complete initialization         OPEN             4
  2702.                      Clear ConnectRetry timer
  2703.         5            Restart ConnectRetry timer      none             3
  2704.         7            Restart ConnectRetry timer      none             2
  2705.                      Initiate a transport connection
  2706.         others       Release resources               none             1
  2707.  
  2708.        Active (3)
  2709.         1                    none                    none             3
  2710.         3            Complete initialization         OPEN             4
  2711.                      Clear ConnectRetry timer
  2712.         5            Close connection                                 3
  2713.                      Restart ConnectRetry timer
  2714.         7            Restart ConnectRetry timer      none             2
  2715.                      Initiate a transport connection
  2716.         others       Release resources               none             1
  2717.  
  2718.        OpenSent(4)
  2719.         1                    none                    none             4
  2720.         4            Close transport connection      none             3
  2721.                      Restart ConnectRetry timer
  2722.         6            Release resources               none             1
  2723.        10            Process OPEN is OK            KEEPALIVE          5
  2724.                      Process OPEN failed           NOTIFICATION       1
  2725.        others        Close transport connection    NOTIFICATION       1
  2726.                      Release resources
  2727.  
  2728.        OpenConfirm (5)
  2729.         1                   none                     none             5
  2730.         4            Release resources               none             1
  2731.         6            Release resources               none             1
  2732.         9            Restart KeepAlive timer       KEEPALIVE          5
  2733.        11            Complete initialization         none             6
  2734.                      Restart Hold Timer
  2735.        13            Close transport connection                       1
  2736.                      Release resources
  2737.        others        Close transport connection    NOTIFICATION       1
  2738.                      Release resources
  2739.  
  2740.  
  2741.  
  2742. Expiration Date January 1994                                   [Page 49]
  2743.  
  2744. INTERNET DRAFT                                                April 1993
  2745.  
  2746.  
  2747.        Established (6)
  2748.         1                   none                     none             6
  2749.         4            Release resources               none             1
  2750.         6            Release resources               none             1
  2751.         9            Restart KeepAlive timer       KEEPALIVE          6
  2752.        11            Restart Hold Timer            KEEPALIVE          6
  2753.        12            Process UPDATE is OK          UPDATE             6
  2754.                      Process UPDATE failed         NOTIFICATION       1
  2755.        13            Close transport connection                       1
  2756.                      Release resources
  2757.        others        Close transport connection    NOTIFICATION       1
  2758.                      Release resources
  2759.       ---------------------------------------------------------------------
  2760.  
  2761.  
  2762.       The following is a condensed version of the above state transition
  2763.       table.
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.    Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab
  2770.          | (1)  |   (2)   |  (3)   |    (4)   |     (5)     |   (6)
  2771.          |---------------------------------------------------------------
  2772.     1    |  2   |    2    |   3    |     4    |      5      |    6
  2773.          |      |         |        |          |             |
  2774.     2    |  1   |    1    |   1    |     1    |      1      |    1
  2775.          |      |         |        |          |             |
  2776.     3    |  1   |    4    |   4    |     1    |      1      |    1
  2777.          |      |         |        |          |             |
  2778.     4    |  1   |    1    |   1    |     3    |      1      |    1
  2779.          |      |         |        |          |             |
  2780.     5    |  1   |    3    |   3    |     1    |      1      |    1
  2781.          |      |         |        |          |             |
  2782.     6    |  1   |    1    |   1    |     1    |      1      |    1
  2783.          |      |         |        |          |             |
  2784.     7    |  1   |    2    |   2    |     1    |      1      |    1
  2785.          |      |         |        |          |             |
  2786.     8    |  1   |    1    |   1    |     1    |      1      |    1
  2787.          |      |         |        |          |             |
  2788.     9    |  1   |    1    |   1    |     1    |      5      |    6
  2789.          |      |         |        |          |             |
  2790.    10    |  1   |    1    |   1    |  1 or 5  |      1      |    1
  2791.          |      |         |        |          |             |
  2792.    11    |  1   |    1    |   1    |     1    |      6      |    6
  2793.          |      |         |        |          |             |
  2794.    12    |  1   |    1    |   1    |     1    |      1      | 1 or 6
  2795.  
  2796.  
  2797.  
  2798. Expiration Date January 1994                                   [Page 50]
  2799.  
  2800. INTERNET DRAFT                                                April 1993
  2801.  
  2802.  
  2803.          |      |         |        |          |             |
  2804.    13    |  1   |    1    |   1    |     1    |      1      |    1
  2805.          |      |         |        |          |             |
  2806.          ---------------------------------------------------------------
  2807.  
  2808.  
  2809.  
  2810.  
  2811. Appendix 2. Comparison with RFC1267
  2812.  
  2813.  
  2814.    BGP-4 is capable of operating in an environment where a set of
  2815.    reachable destinations may be expressed via a single IP prefix.  The
  2816.    concept of network classes, or subnetting is foreign to BGP-4.  To
  2817.    accommodate these capabilities BGP-4 changes semantics and encoding
  2818.    associated with the AS_PATH attribute. New text has been added to
  2819.    define semantics associated with IP prefixes.  These abilities allow
  2820.    BGP-4 to support the proposed supernetting scheme [9].
  2821.  
  2822.    To simplify configuration this version introduces a new attribute,
  2823.    LOCAL_PREF, that facilitates route selection procedures.
  2824.  
  2825.    The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC.
  2826.    A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that
  2827.    certain aggregates are not de-aggregated.  Another new attribute,
  2828.    AGGREGATOR, can be added to aggregate routes in order to advertise
  2829.    which AS caused the aggregation.
  2830.  
  2831.    To insure that Hold Timers are symmetric, the Hold Time is now
  2832.    negotiated on a per-connection basis.
  2833.  
  2834. Appendix 3.  Comparison with RFC 1163
  2835.  
  2836.  
  2837.    All of the changes listed in Appendix 2, plus the following.
  2838.  
  2839.    To detect and recover from BGP connection collision, a new field (BGP
  2840.    Identifier) has been added to the OPEN message. New text (Section
  2841.    6.8) has been added to specify the procedure for detecting and
  2842.    recovering from collision.
  2843.  
  2844.    The new document no longer restricts the border router that is passed
  2845.    in the NEXT_HOP path attribute to be part of the same Autonomous
  2846.    System as the BGP Speaker.
  2847.  
  2848.    New document optimizes and simplifies the exchange of the information
  2849.    about previously reachable routes.
  2850.  
  2851.  
  2852.  
  2853.  
  2854. Expiration Date January 1994                                   [Page 51]
  2855.  
  2856. INTERNET DRAFT                                                April 1993
  2857.  
  2858.  
  2859. Appendix 4.  Comparison with RFC 1105
  2860.  
  2861.  
  2862.    All of the changes listed in Appendices 2 and 3, plus the following.
  2863.  
  2864.    Minor changes to the RFC1105 Finite State Machine were necessary to
  2865.    accommodate the TCP user interface provided by 4.3 BSD.
  2866.  
  2867.    The notion of Up/Down/Horizontal relations present in RFC1105 has
  2868.    been removed from the protocol.
  2869.  
  2870.    The changes in the message format from RFC1105 are as follows:
  2871.  
  2872.       1.  The Hold Time field has been removed from the BGP header and
  2873.       added to the OPEN message.
  2874.  
  2875.       2.  The version field has been removed from the BGP header and
  2876.       added to the OPEN message.
  2877.  
  2878.       3.  The Link Type field has been removed from the OPEN message.
  2879.  
  2880.       4.  The OPEN CONFIRM message has been eliminated and replaced with
  2881.       implicit confirmation provided by the KEEPALIVE message.
  2882.  
  2883.       5.  The format of the UPDATE message has been changed
  2884.       significantly.  New fields were added to the UPDATE message to
  2885.       support multiple path attributes.
  2886.  
  2887.       6.  The Marker field has been expanded and its role broadened to
  2888.       support authentication.
  2889.  
  2890.       Note that quite often BGP, as specified in RFC 1105, is referred
  2891.       to as BGP-1, BGP, as specified in RFC 1163, is referred to as
  2892.       BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and
  2893.       BGP, as specified in this document is referred to as BGP-4.
  2894.  
  2895.  
  2896. Appendix 5.  TCP options that may be used with BGP
  2897.  
  2898.  
  2899.    If a local system TCP user interface supports TCP PUSH function, then
  2900.    each BGP message should be transmitted with PUSH flag set.  Setting
  2901.    PUSH flag forces BGP messages to be transmitted promptly to the
  2902.    receiver.
  2903.  
  2904.    If a local system TCP user interface supports setting precedence for
  2905.    TCP connection, then the BGP transport connection should be opened
  2906.    with precedence set to Internetwork Control (110) value (see also
  2907.  
  2908.  
  2909.  
  2910. Expiration Date January 1994                                   [Page 52]
  2911.  
  2912. INTERNET DRAFT                                                April 1993
  2913.  
  2914.  
  2915.    [6]).
  2916.  
  2917.  
  2918.  
  2919. Appendix 6.  Implementation Recommendations
  2920.  
  2921.  
  2922.       This section presents some implementation recommendations.
  2923.  
  2924.  
  2925. 6.1 Multiple Networks Per Message
  2926.  
  2927.  
  2928.    The BGP protocol allows for multiple networks with the same AS path
  2929.    and next-hop gateway to be specified in one message. Making use of
  2930.    this capability is highly recommended. With one network per message
  2931.    there is a substantial increase in overhead in the receiver. Not only
  2932.    does the system overhead increase due to the reception of multiple
  2933.    messages, but the overhead of scanning the routing table for updates
  2934.    to BGP peers and other routing protocols (and sending the associated
  2935.    messages) is incurred multiple times as well. One method of building
  2936.    messages containing many networks per AS path and gateway from a
  2937.    routing table that is not organized per AS path is to build many
  2938.    messages as the routing table is scanned. As each network is
  2939.    processed, a message for the associated AS path and gateway is
  2940.    allocated, if it does not exist, and the new network is added to it.
  2941.    If such a message exists, the new network is just appended to it. If
  2942.    the message lacks the space to hold the new network, it is
  2943.    transmitted, a new message is allocated, and the new network is
  2944.    inserted into the new message. When the entire routing table has been
  2945.    scanned, all allocated messages are sent and their resources
  2946.    released.  Maximum compression is achieved when all networks share a
  2947.    gateway and common path attributes, making it possible to send many
  2948.    networks in one 4096-byte message.
  2949.  
  2950.    When peering with a BGP implementation that does not compress
  2951.    multiple networks into one message, it may be necessary to take steps
  2952.    to reduce the overhead from the flood of data received when a peer is
  2953.    acquired or a significant network topology change occurs. One method
  2954.    of doing this is to limit the rate of updates. This will eliminate
  2955.    the redundant scanning of the routing table to provide flash updates
  2956.    for BGP peers and other routing protocols. A disadvantage of this
  2957.    approach is that it increases the propagation latency of routing
  2958.    information.  By choosing a minimum flash update interval that is not
  2959.    much greater than the time it takes to process the multiple messages
  2960.    this latency should be minimized. A better method would be to read
  2961.    all received messages before sending updates.
  2962.  
  2963.  
  2964.  
  2965.  
  2966. Expiration Date January 1994                                   [Page 53]
  2967.  
  2968. INTERNET DRAFT                                                April 1993
  2969.  
  2970.  
  2971. 6.2  Processing Messages on a Stream Protocol
  2972.  
  2973.  
  2974.    BGP uses TCP as a transport mechanism.  Due to the stream nature of
  2975.    TCP, all the data for received messages does not necessarily arrive
  2976.    at the same time. This can make it difficult to process the data as
  2977.    messages, especially on systems such as BSD Unix where it is not
  2978.    possible to determine how much data has been received but not yet
  2979.    processed.
  2980.  
  2981.    One method that can be used in this situation is to first try to read
  2982.    just the message header. For the KEEPALIVE message type, this is a
  2983.    complete message; for other message types, the header should first be
  2984.    verified, in particular the total length. If all checks are
  2985.    successful, the specified length, minus the size of the message
  2986.    header is the amount of data left to read. An implementation that
  2987.    would "hang" the routing information process while trying to read
  2988.    from a peer could set up a message buffer (4096 bytes) per peer and
  2989.    fill it with data as available until a complete message has been
  2990.    received.
  2991.  
  2992.  
  2993. 6.3 Reducing route flapping
  2994.  
  2995.  
  2996.    To avoid excessive route flapping a BGP speaker which needs to
  2997.    withdraw a destination and send an update about a more specific or
  2998.    less specific route shall combine them into the same UPDATE message.
  2999.  
  3000.  
  3001. 6.4 BGP Timers
  3002.  
  3003.  
  3004.    BGP employs five timers: ConnectRetry, Hold Time, KeepAlive,
  3005.    MinRouteOriginationInterval, and MinRouteAdvertisementInterval The
  3006.    suggested value for the ConnectRetry timer is 120 seconds.  The
  3007.    suggested value for the Hold Time is 90 seconds.  The suggested value
  3008.    for the KeepAlive timer is 30 seconds.  The suggested value for the
  3009.    MinRouteOriginationInterval is 15 minutes.  The suggested value for
  3010.    the MinRouteAdvertisementInterval is 30 seconds.
  3011.  
  3012.    An implementation of BGP MUST allow these timers to be configurable.
  3013.  
  3014.  
  3015. 6.5 Path attribute ordering
  3016.  
  3017.  
  3018.    Implementations which combine update messages as described above in
  3019.  
  3020.  
  3021.  
  3022. Expiration Date January 1994                                   [Page 54]
  3023.  
  3024. INTERNET DRAFT                                                April 1993
  3025.  
  3026.  
  3027.    6.1 may prefer to see all path attributes presented in a known order.
  3028.    This permits them to quickly identify sets of attributes from
  3029.    different update messages which are semantically identical.  To
  3030.    facilitate this, it is a useful optimization to order the path
  3031.    attributes according to type code.  This optimization is entirely
  3032.    optional.
  3033.  
  3034.  
  3035. 6.6 AS_SET sorting
  3036.  
  3037.  
  3038.    Another useful optimization that can be done to simplify this
  3039.    situation is to sort the AS numbers found in an AS_SET.  This
  3040.    optimization is entirely optional.
  3041.  
  3042.  
  3043. 6.7 Control over version negotiation
  3044.  
  3045.  
  3046.    Since BGP-4 is capable of carrying aggregated routes which cannot be
  3047.    properly represented in BGP-3, an implementation which supports BGP-4
  3048.    and another BGP version should provide the capability to only speak
  3049.    BGP-4 on a per-neighbor basis.
  3050.  
  3051.  
  3052. 6.8 Complex AS_PATH aggregation
  3053.  
  3054.  
  3055.    An implementation which chooses to provide a path aggregation
  3056.    algorithm which retains significant amounts of path information may
  3057.    wish to use the following procedure:
  3058.  
  3059.       For the purpose of aggregating AS_PATH attributes of two routes,
  3060.       we model each AS as a tuple <type, value>, where "type" identifies
  3061.       a type of the path segment the AS belongs to (e.g.  AS_SEQUENCE,
  3062.       AS_SET), and "value" is the AS number.  Two ASs are said to be the
  3063.       same if their corresponding <type, value> tuples are the same.
  3064.  
  3065.       The algorithm to aggregate two AS_PATH attributes works as
  3066.       follows:
  3067.  
  3068.          a) Identify the same ASs (as defined above) within each AS_PATH
  3069.          attribute that are in the same relative order within both
  3070.          AS_PATH attributes.  Two ASs, X and Y, are said to be in the
  3071.          same order if either:
  3072.             - X precedes Y in both AS_PATH attributes, or - Y precedes X
  3073.             in both AS_PATH attributes.
  3074.  
  3075.  
  3076.  
  3077.  
  3078. Expiration Date January 1994                                   [Page 55]
  3079.  
  3080. INTERNET DRAFT                                                April 1993
  3081.  
  3082.  
  3083.          b) The aggregated AS_PATH attribute consists of ASs identified
  3084.          in (a) in exactly the same order as they appear in the AS_PATH
  3085.          attributes to be aggregated. If two consecutive ASs identified
  3086.          in (a) do not immediately follow each other in both of the
  3087.          AS_PATH attributes to be aggregated, then the intervening ASs
  3088.          (ASs that are between the two consecutive ASs that are the
  3089.          same) in both attributes are combined into an AS_SET path
  3090.          segment that consists of the intervening ASs from both AS_PATH
  3091.          attributes; this segment is then placed in between the two
  3092.          consecutive ASs identified in (a) of the aggregated attribute.
  3093.          If two consecutive ASs identified in (a) immediately follow
  3094.          each other in one attribute, but do not follow in another, then
  3095.          the intervening ASs of the latter are combined into an AS_SET
  3096.          path segment; this segment is then placed in between the two
  3097.          consecutive ASs identified in (a) of the aggregated attribute.
  3098.  
  3099.  
  3100.       If as a result of the above procedure a given AS number appears
  3101.       more than once within the aggregated AS_PATH attribute, all, but
  3102.       the last instance (rightmost occurrence) of that AS number should
  3103.       be removed from the aggregated AS_PATH attribute.
  3104.  
  3105. References
  3106.  
  3107.  
  3108.    [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC
  3109.    904, BBN, April 1984.
  3110.  
  3111.    [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET
  3112.    Backbone", RFC 1092, T.J. Watson Research Center, February 1989.
  3113.  
  3114.    [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093,
  3115.    MERIT/NSFNET Project, February 1989.
  3116.  
  3117.    [4] Postel, J., "Transmission Control Protocol - DARPA Internet
  3118.    Program Protocol Specification", RFC 793, DARPA, September 1981.
  3119.  
  3120.    [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway
  3121.    Protocol in the Internet", RFC 1268, T.J. Watson Research Center, IBM
  3122.    Corp., ANS, October 1991.
  3123.  
  3124.    [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol
  3125.    Specification", RFC 791, DARPA, September 1981.
  3126.  
  3127.    [7] "Information Processing Systems - Telecommunications and
  3128.    Information Exchange between Systems - Protocol for Exchange of
  3129.    Inter-domain Routeing Information among Intermediate Systems to
  3130.    Support Forwarding of ISO 8473 PDUs", ISO/IEC JTC 1/SC 6 N7196, March
  3131.  
  3132.  
  3133.  
  3134. Expiration Date January 1994                                   [Page 56]
  3135.  
  3136. INTERNET DRAFT                                                April 1993
  3137.  
  3138.  
  3139.    1992.
  3140.  
  3141.    [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., "Supernetting: an
  3142.    Address Assignment and Aggregation Strategy", Internet Draft, 1992.
  3143.  
  3144.  
  3145. Security Considerations
  3146.  
  3147.    Security issues are not discussed in this memo.
  3148.  
  3149.  
  3150. Editors' Addresses
  3151.  
  3152.    Yakov Rekhter
  3153.    T.J. Watson Research Center IBM Corporation
  3154.    P.O. Box 218
  3155.    Yorktown Heights, NY 10598
  3156.    Phone:  (914) 945-3896
  3157.    email:  yakov@watson.ibm.com
  3158.  
  3159.    Tony Li
  3160.    cisco Systems, Inc.
  3161.    1525 O'Brien Drive
  3162.    Menlo Park, CA 94025
  3163.    email: tli@cisco.com
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190. Expiration Date January 1994                                   [Page 57]
  3191.  
  3192.